[cogl-material] Adds a cogl_material_set_color4f convenience function
authorRobert Bragg <robert@linux.intel.com>
Fri, 1 May 2009 08:53:20 +0000 (09:53 +0100)
committerRobert Bragg <robert@linux.intel.com>
Sat, 2 May 2009 03:12:26 +0000 (04:12 +0100)
This is simply a wrapper around cogl_color_set_from_4f and
cogl_material_set_color. We already had a prototype for this, it was
an oversight that it wasn't already implemented.

clutter/cogl/cogl-material.h
clutter/cogl/common/cogl-material.c

index c77b091..95a4748 100644 (file)
@@ -109,7 +109,7 @@ void cogl_material_set_color (CoglHandle material, const CoglColor *color);
  *
  * This is the basic color of the material, used when no lighting is enabled.
  *
- * The default value is (1.0, 1.0, 1.0, 1.0)
+ * The default value is (0xff, 0xff, 0xff, 0xff)
  *
  * Since 1.0
  */
@@ -134,7 +134,7 @@ void cogl_material_set_color4ub (CoglHandle material,
  * Since 1.0
  */
 void cogl_material_set_color4f (CoglHandle material,
-                               float      red,
+                                float      red,
                                 float      green,
                                 float      blue,
                                 float      alpha);
index 2c7df33..c456cac 100644 (file)
@@ -194,6 +194,18 @@ cogl_material_set_color4ub (CoglHandle handle,
 }
 
 void
+cogl_material_set_color4f (CoglHandle handle,
+                          float red,
+                           float green,
+                           float blue,
+                           float alpha)
+{
+  CoglColor color;
+  cogl_color_set_from_4f (&color, red, green, blue, alpha);
+  cogl_material_set_color (handle, &color);
+}
+
+void
 cogl_material_get_ambient (CoglHandle  handle,
                            CoglColor  *ambient)
 {