1
0
Fork 0

[cogl_read_pixels] fixes for calculating the y offset when rendering offscreen

Since offscreen rendering is forced to be upside down we don't need to do
any conversion of the users coordinates to go from Cogl window coordinates
to OpenGL window coordinates.
This commit is contained in:
Robert Bragg 2009-11-02 01:12:10 +00:00
parent 800d18bc19
commit b8fe310b6d

View file

@ -809,8 +809,13 @@ cogl_read_pixels (int x,
draw_buffer_height = _cogl_draw_buffer_get_height (draw_buffer);
/* The y co-ordinate should be given in OpenGL's coordinate system
so 0 is the bottom row */
y = draw_buffer_height - y - height;
* so 0 is the bottom row
*
* NB: all offscreen rendering is done upside down so no conversion
* is necissary in this case.
*/
if (!cogl_is_offscreen (draw_buffer))
y = draw_buffer_height - y - height;
/* Setup the pixel store parameters that may have been changed by
Cogl */