From 76faa8c7a667cb0c54c9b25c89cfb389c1c18cd3 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 18 Sep 2008 11:24:27 +0000 Subject: [PATCH] Bug 1044 - cogl_get_viewport error * clutter/cogl/gles/cogl.c (cogl_get_viewport): Use glGetIntegerv instead of glGetFixedv to read the viewport because the latter converts incorrectly on some hardware. --- ChangeLog | 8 ++++++++ clutter/cogl/gles/cogl.c | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c514e4196..8f7d1ca3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-18 Neil Roberts + + Bug 1044 - cogl_get_viewport error + + * clutter/cogl/gles/cogl.c (cogl_get_viewport): Use glGetIntegerv + instead of glGetFixedv to read the viewport because the latter + converts incorrectly on some hardware. + 2008-09-18 Neil Roberts Bug 1080 - clutter_stage_read_pixels has upside-down y coordinate diff --git a/clutter/cogl/gles/cogl.c b/clutter/cogl/gles/cogl.c index 95ca10eef..7259680af 100644 --- a/clutter/cogl/gles/cogl.c +++ b/clutter/cogl/gles/cogl.c @@ -862,7 +862,13 @@ cogl_get_projection_matrix (ClutterFixed m[16]) void cogl_get_viewport (ClutterFixed v[4]) { - cogl_wrap_glGetFixedv(GL_VIEWPORT, &v[0]); + GLint viewport[4]; + int i; + + cogl_wrap_glGetIntegerv (GL_VIEWPORT, viewport); + + for (i = 0; i < 4; i++) + v[i] = CLUTTER_INT_TO_FIXED (viewport[i]); } void