From d18e432b2284cdc87236153f703631b317f91e92 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Tue, 1 May 2007 20:13:15 +0000 Subject: [PATCH] fixed sign problem in cogl_setup_vieport --- gles/cogl.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gles/cogl.c b/gles/cogl.c index 29c5c9c6d..79172f01b 100644 --- a/gles/cogl.c +++ b/gles/cogl.c @@ -525,13 +525,16 @@ cogl_perspective (ClutterAngle fovy, #endif void -cogl_setup_viewport (guint width, - guint height, +cogl_setup_viewport (guint w, + guint h, ClutterAngle fovy, ClutterFixed aspect, ClutterFixed z_near, ClutterFixed z_far) { + gint width = (gint) w; + gint height = (gint) h; + GE( glViewport (0, 0, width, height) ); #define NEG(x) (1 + ~(x)) @@ -560,12 +563,27 @@ cogl_setup_viewport (guint width, -1 << 15, NEG(CLUTTER_FLOAT_TO_FIXED(DEFAULT_Z_CAMERA))) ); + g_debug ("TX1: %f/%f %f/%f %f/%f", + CLUTTER_FIXED_TO_DOUBLE (-1 << 15), -0.5, + CLUTTER_FIXED_TO_DOUBLE (-1 << 15), -0.5, + CLUTTER_FIXED_TO_DOUBLE (NEG(CLUTTER_FLOAT_TO_FIXED(DEFAULT_Z_CAMERA))), + -DEFAULT_Z_CAMERA); + GE( glScalex ( CFX_ONE / width, NEG(CFX_ONE) / height, CFX_ONE / width)); + g_debug ("SX: %f/%f %f/%f, w %d, h %d", + CLUTTER_FIXED_TO_DOUBLE (CFX_ONE / width), 1.0f / width, + CLUTTER_FIXED_TO_DOUBLE (NEG(CFX_ONE) / height), -1.0f / height, + width, height); + GE( glTranslatex (0, NEG(CFX_ONE) * height, 0) ); + g_debug ("TX2: %f/%f", + CLUTTER_FIXED_TO_DOUBLE (NEG(CFX_ONE) * height), + -1.0 * height); + #if 0 GE( glTranslatex (NEG(CFX_HALF), NEG(CFX_HALF),