From 70d7d16f13d35392e1f46d87dc245713fd4e68f3 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 26 Jan 2009 22:52:38 +0000 Subject: [PATCH] Support scaling on the z axis with cogl_scale This simply adds a z argument to cogl_scale and updates clutter-actor.c to pass 1.0 for the z scale. --- README | 2 ++ clutter/clutter-actor.c | 2 +- clutter/cogl/cogl.h.in | 8 +++++--- clutter/cogl/gl/cogl.c | 4 ++-- clutter/cogl/gles/cogl.c | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README b/README index 222c28cc3..38facd87f 100644 --- a/README +++ b/README @@ -251,6 +251,8 @@ Release Notes for Clutter 1.0 * cogl_alpha_func has been removed, since this is now controlled using the material API via cogl_material_set_alpha_test_function () +* cogl_scale now supports scaling on the z axis + Release Notes for Clutter 0.8 ------------------------------- diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index c5445aab9..9d8df3162 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1369,7 +1369,7 @@ _clutter_actor_apply_modelview_transform (ClutterActor *self) * entire object will move on the screen as a result of rotating it). */ if (priv->scale_x != 1.0 || priv->scale_y != 1.0) - cogl_scale (priv->scale_x, priv->scale_y); + cogl_scale (priv->scale_x, priv->scale_y, 1.0); if (priv->rzang) { diff --git a/clutter/cogl/cogl.h.in b/clutter/cogl/cogl.h.in index ff35f33d6..912fffe7d 100644 --- a/clutter/cogl/cogl.h.in +++ b/clutter/cogl/cogl.h.in @@ -226,12 +226,14 @@ void cogl_pop_matrix (void); * cogl_scale: * @x: Amount to scale along the x-axis * @y: Amount to scale along the y-axis + * @z: Amount to scale along the z-axis * - * Multiplies the current model-view matrix by one that scales the x - * and y axes by the given values. + * Multiplies the current model-view matrix by one that scales the x, + * y and z axes by the given values. */ void cogl_scale (float x, - float y); + float y, + float z); /** * cogl_translate: diff --git a/clutter/cogl/gl/cogl.c b/clutter/cogl/gl/cogl.c index e82bd9fea..62515c65c 100644 --- a/clutter/cogl/gl/cogl.c +++ b/clutter/cogl/gl/cogl.c @@ -213,9 +213,9 @@ cogl_pop_matrix (void) } void -cogl_scale (float x, float y) +cogl_scale (float x, float y, float z) { - GE( glScalef (x, y, 1.0) ); + GE( glScalef (x, y, z) ); } void diff --git a/clutter/cogl/gles/cogl.c b/clutter/cogl/gles/cogl.c index 32f4c71dd..0b087a161 100644 --- a/clutter/cogl/gles/cogl.c +++ b/clutter/cogl/gles/cogl.c @@ -130,9 +130,9 @@ cogl_pop_matrix (void) } void -cogl_scale (float x, float y) +cogl_scale (float x, float y, float z) { - GE( glScalef (x, y, 1.0) ); + GE( glScalef (x, y, z) ); } void