diff options
author | Robert Bragg <robert@linux.intel.com> | 2012-04-10 19:17:12 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2012-04-16 18:47:11 +0100 |
commit | c69d92bd7058c58f1567c3eaf1094b326d937ac8 (patch) | |
tree | f620e006ab644522f5e344847a67d839ebd619ef | |
parent | 834b19767b74bd74f7a3653c376535a672fc1625 (diff) | |
download | cogl-c69d92bd7058c58f1567c3eaf1094b326d937ac8.tar.gz |
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)
-rw-r--r-- | 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 ba23b383..ced6a3f3 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); |