From c69d92bd7058c58f1567c3eaf1094b326d937ac8 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 10 Apr 2012 19:17:12 +0100 Subject: 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 (cherry picked from commit 836d54445dc2e222b832ef0a7b6451668d8da0dd) --- examples/cogl-msaa.c | 9 +++++---- 1 file 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); -- cgit v1.2.1