[cogl/cogl-1.10] Use cogl_framebuffer_draw_rectangle api
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.10] Use cogl_framebuffer_draw_rectangle api
- Date: Mon, 16 Apr 2012 17:52:23 +0000 (UTC)
commit c69d92bd7058c58f1567c3eaf1094b326d937ac8
Author: Robert Bragg <robert linux intel com>
Date: Tue Apr 10 19:17:12 2012 +0100
Use cogl_framebuffer_draw_rectangle api
Instead of using cogl_rectangle() this example now uses
cogl_framebuffer_draw_rectangle(). This fixes a crash due to the example
not pushing a current framebuffer before calling cogl_rectangle().
Reviewed-by: Neil Roberts <neil linux intel com>
(cherry picked from commit 836d54445dc2e222b832ef0a7b6451668d8da0dd)
examples/cogl-msaa.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/examples/cogl-msaa.c b/examples/cogl-msaa.c
index ba23b38..ced6a3f 100644
--- a/examples/cogl-msaa.c
+++ b/examples/cogl-msaa.c
@@ -85,6 +85,7 @@ main (int argc, char **argv)
CoglPollFD *poll_fds;
int n_poll_fds;
gint64 timeout;
+ CoglPipeline *texture_pipeline;
cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
@@ -94,13 +95,13 @@ main (int argc, char **argv)
cogl_framebuffer_draw_primitive (fb, pipeline, triangle);
cogl_framebuffer_pop_matrix (fb);
- cogl_push_framebuffer (offscreen_fb);
cogl_framebuffer_draw_primitive (fb, pipeline, triangle);
cogl_framebuffer_resolve_samples (offscreen_fb);
- cogl_pop_framebuffer ();
- cogl_set_source_texture (tex);
- cogl_rectangle (0, 1, 1, -1);
+ texture_pipeline = cogl_pipeline_new (ctx);
+ cogl_pipeline_set_layer_texture (texture_pipeline, 0, tex);
+ cogl_framebuffer_draw_rectangle (fb, texture_pipeline, 0, 1, 1, -1);
+ cogl_object_unref (texture_pipeline);
cogl_onscreen_swap_buffers (onscreen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]