From d1de286109a66797a0b3badd4fbb3064a5b1335f Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 2 Nov 2009 01:10:02 +0000 Subject: [PATCH] [cogl_read_pixels] ensure we flush the current draw buffer state before reading Make sure we call _cogl_draw_buffer_flush_state() before glReadPixels() to be sure we have bound the correct framebuffer. --- cogl/cogl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogl/cogl.c b/cogl/cogl.c index c34205290..1b2e9c46a 100644 --- a/cogl/cogl.c +++ b/cogl/cogl.c @@ -806,6 +806,9 @@ cogl_read_pixels (int x, temprow = g_alloca (rowstride * sizeof (guint8)); draw_buffer = _cogl_get_draw_buffer (); + + _cogl_draw_buffer_flush_state (draw_buffer, 0); + draw_buffer_height = _cogl_draw_buffer_get_height (draw_buffer); /* The y co-ordinate should be given in OpenGL's coordinate system