Removes cogl_blend_func and cogl_alpha_func
authorRobert Bragg <robert@linux.intel.com>
Sat, 24 Jan 2009 15:09:43 +0000 (15:09 +0000)
committerRobert Bragg <robert@linux.intel.com>
Tue, 27 Jan 2009 14:26:49 +0000 (14:26 +0000)
The GL blend function and alpha function are now controlled by the material
code, and even internally Cogl should now be using the material API when
it needs control of these.

README
clutter/cogl/cogl.h.in
clutter/cogl/common/cogl-material.c
clutter/cogl/gl/cogl-context.c
clutter/cogl/gl/cogl-context.h
clutter/cogl/gl/cogl.c
clutter/cogl/gles/cogl.c

diff --git a/README b/README
index c179fae..222c28c 100644 (file)
--- a/README
+++ b/README
@@ -248,6 +248,9 @@ Release Notes for Clutter 1.0
 * A CoglMesh type and utility API has been added; this is currently used to
   support describing texture matrices.
 
+* cogl_alpha_func has been removed, since this is now controlled using the
+  material API via cogl_material_set_alpha_test_function ()
+
 Release Notes for Clutter 0.8
 -------------------------------
 
index e0cf44a..ff35f33 100644 (file)
@@ -406,19 +406,6 @@ void            cogl_enable_depth_test        (gboolean            setting);
 void            cogl_enable_backface_culling  (gboolean            setting);
 
 /**
- * cogl_alpha_func:
- * @func: the comparison function to use, one of CGL_NEVER, CGL_LESS,
- * CGL_EQUAL, CGL_LEQUAL, CGL_GREATER, CGL_NOTEQUAL, CGL_GEQUAL and GL_ALWAYS.
- * @ref: reference value.
- *
- * Changes the alpha test to use the specified function specified in @func,
- * comparing with the value in @ref. The default function is CGL_ALWAYS the
- * initial reference value is 1.0.
- */
-void            cogl_alpha_func               (COGLenum            func,
-                                               float        ref);
-
-/**
  * cogl_fog_set:
  * @fog_color: The color of the fog
  * @density: Ignored
index 0b4b9dc..5b3c749 100644 (file)
 #include <glib.h>
 #include <string.h>
 
+/*
+ * GL/GLES compatability defines for material thingies:
+ */
+
+#ifdef HAVE_COGL_GLES2
+#define glAlphaFunc cogl_wrap_glAlphaFunc
+#endif
+
 static void _cogl_material_free (CoglMaterial *tex);
 static void _cogl_material_layer_free (CoglMaterialLayer *layer);
 
index 6a3c032..252f3d2 100644 (file)
@@ -81,9 +81,6 @@ cogl_create_context ()
   _context->fbo_handles = NULL;
   _context->draw_buffer = COGL_WINDOW_BUFFER;
 
-  _context->blend_src_factor = CGL_SRC_ALPHA;
-  _context->blend_dst_factor = CGL_ONE_MINUS_SRC_ALPHA;
-
   _context->shader_handles = NULL;
 
   _context->program_handles = NULL;
index db3a333..2f0dd08 100644 (file)
@@ -45,8 +45,6 @@ typedef struct
   /* Enable cache */
   gulong            enable_flags;
   guint8            color_alpha;
-  COGLenum          blend_src_factor;
-  COGLenum          blend_dst_factor;
 
   gboolean          enable_backface_culling;
 
index 3568493..4735850 100644 (file)
@@ -316,23 +316,6 @@ cogl_get_enable ()
 }
 
 void
-cogl_blend_func (COGLenum src_factor, COGLenum dst_factor)
-{
-  /* This function caches the blending setup in the
-   * hope of lessening GL traffic.
-   */
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
-  if (ctx->blend_src_factor != src_factor ||
-      ctx->blend_dst_factor != dst_factor)
-    {
-      glBlendFunc (src_factor, dst_factor);
-      ctx->blend_src_factor = src_factor;
-      ctx->blend_dst_factor = dst_factor;
-    }
-}
-
-void
 cogl_enable_depth_test (gboolean setting)
 {
   if (setting)
@@ -578,13 +561,6 @@ _cogl_disable_clip_planes (void)
 }
 
 void
-cogl_alpha_func (COGLenum     func,
-                float ref)
-{
-  GE( glAlphaFunc (func, (ref)) );
-}
-
-void
 cogl_perspective (float fovy,
                  float aspect,
                  float zNear,
index 717b1e1..373072d 100644 (file)
@@ -230,23 +230,6 @@ cogl_get_enable ()
 }
 
 void
-cogl_blend_func (COGLenum src_factor, COGLenum dst_factor)
-{
-  /* This function caches the blending setup in the
-   * hope of lessening GL traffic.
-   */
-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-  
-  if (ctx->blend_src_factor != src_factor ||
-      ctx->blend_dst_factor != dst_factor)
-    {
-      glBlendFunc (src_factor, dst_factor);
-      ctx->blend_src_factor = src_factor;
-      ctx->blend_dst_factor = dst_factor;
-    }
-}
-
-void
 cogl_enable_depth_test (gboolean setting)
 {
   if (setting)
@@ -498,13 +481,6 @@ _cogl_disable_clip_planes (void)
   GE( cogl_wrap_glDisable (GL_CLIP_PLANE0) );
 }
 
-void
-cogl_alpha_func (COGLenum     func, 
-                float ref)
-{
-  GE( cogl_wrap_glAlphaFunc (func, (ref)) );
-}
-
 /*
  * Fixed point implementation of the perspective function
  */