From 801d55621ea388b65eb0dbd4b4e3e8a11d8912e0 Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <ebassi@openedhand.com>
Date: Wed, 16 Jan 2008 10:38:05 +0000
Subject: [PATCH] 2008-01-16  Emmanuele Bassi  <ebassi@openedhand.com>

	* clutter/cogl/cogl.h: Rename COGLhandleARB to COGLhandle.

	* clutter/cogl/gl/cogl-defines.h.in:
	* clutter/cogl/gl/cogl.c: Update GL implementation of COGL.

	* clutter/cogl/gles/cogl-defines.h:
	* clutter/cogl/gles/cogl.c: Update GLES implementation of COGL.

	* clutter/clutter-shader.c: Fix ClutterShader to use the new
	COGLhandle type instead of COGLhandlerARB.
---
 cogl.h               | 41 ++++++++++++++++++++---------------------
 gl/cogl-defines.h.in |  2 +-
 gl/cogl.c            | 38 +++++++++++++++++++-------------------
 gles/cogl-defines.h  |  2 +-
 gles/cogl.c          | 36 ++++++++++++++++++------------------
 5 files changed, 59 insertions(+), 60 deletions(-)

diff --git a/cogl.h b/cogl.h
index fe2bbe2a6..ae3d2a04f 100644
--- a/cogl.h
+++ b/cogl.h
@@ -214,50 +214,50 @@ cogl_fog_set (const ClutterColor *fog_color,
               ClutterFixed        z_far);
 
 
-COGLhandleARB
-cogl_create_shader               (COGLenum     shaderType);
+COGLhandle
+cogl_create_shader                (COGLenum     shaderType);
 
 void
-cogl_shader_destroy              (COGLhandleARB handle);
+cogl_shader_destroy               (COGLhandle   handle);
 
 
 void
-cogl_shader_source               (COGLhandleARB  shader,
-                                  const gchar   *source);
+cogl_shader_source                (COGLhandle   shader,
+                                   const gchar *source);
 void
-cogl_shader_compile               (COGLhandleARB shader_handle);
+cogl_shader_compile               (COGLhandle   shader_handle);
 
 void
-cogl_shader_get_info_log          (COGLhandleARB handle,
-                                   guint         size,
-                                   gchar        *buffer);
+cogl_shader_get_info_log          (COGLhandle   handle,
+                                   guint        size,
+                                   gchar       *buffer);
 
 void
-cogl_shader_get_parameteriv       (COGLhandleARB handle,
-                                   COGLenum      pname,
-                                   COGLint      *dest);
+cogl_shader_get_parameteriv       (COGLhandle   handle,
+                                   COGLenum     pname,
+                                   COGLint     *dest);
 
 
-COGLhandleARB
+COGLhandle
 cogl_create_program               (void);
 
 void
-cogl_program_destroy              (COGLhandleARB handle);
+cogl_program_destroy              (COGLhandle   handle);
 
 void
-cogl_program_attach_shader        (COGLhandleARB program_handle,
-                                   COGLhandleARB shader_handle);
+cogl_program_attach_shader        (COGLhandle   program_handle,
+                                   COGLhandle   shader_handle);
 
 /* 0 to use none */
 void
-cogl_program_link                 (COGLhandleARB program_handle);
+cogl_program_link                 (COGLhandle   program_handle);
 
 void
-cogl_program_use                  (COGLhandleARB program_handle);
+cogl_program_use                  (COGLhandle   program_handle);
 
 COGLint
-cogl_program_get_uniform_location (COGLhandleARB  program_int,
-                                   const gchar   *uniform_name);
+cogl_program_get_uniform_location (COGLhandle   program_int,
+                                   const gchar *uniform_name);
 
 
 void
@@ -268,4 +268,3 @@ cogl_program_uniform_1f           (COGLint      uniform_no,
 G_END_DECLS
 
 #endif /* __COGL_H__ */
-
diff --git a/gl/cogl-defines.h.in b/gl/cogl-defines.h.in
index dd7e4ef4d..36a99a806 100644
--- a/gl/cogl-defines.h.in
+++ b/gl/cogl-defines.h.in
@@ -42,7 +42,7 @@ G_BEGIN_DECLS
 typedef GLenum COGLenum;
 typedef GLint COGLint;
 typedef GLuint COGLuint;
-typedef GLhandleARB COGLhandleARB;
+typedef GLhandleARB COGLhandle;
 
 /* FIXME + DOCUMENT */
 
diff --git a/gl/cogl.c b/gl/cogl.c
index 5f6395927..a09914cb6 100644
--- a/gl/cogl.c
+++ b/gl/cogl.c
@@ -803,14 +803,14 @@ cogl_fog_set (const ClutterColor *fog_color,
 
 #endif
 
-COGLhandleARB
+COGLhandle
 cogl_create_program (void)
 {
   PROC (GLhandleARB, 0, glCreateProgramObjectARB, void);
   return proc ();
 }
 
-COGLhandleARB
+COGLhandle
 cogl_create_shader (COGLenum shaderType)
 {
   PROC (GLhandleARB, 0, glCreateShaderObjectARB, GLenum);
@@ -818,68 +818,68 @@ cogl_create_shader (COGLenum shaderType)
 }
 
 void
-cogl_shader_source (COGLhandleARB  shader,
-                    const gchar   *source)
+cogl_shader_source (COGLhandle   shader,
+                    const gchar *source)
 {
   PROC (GLvoid,, glShaderSourceARB, GLhandleARB, GLsizei, const GLcharARB **, const GLint *)
   proc (shader, 1, &source, NULL);
 }
 
 void
-cogl_shader_compile (COGLhandleARB shader_handle)
+cogl_shader_compile (COGLhandle shader_handle)
 {
   PROC (GLvoid,, glCompileShaderARB, GLhandleARB);
   proc (shader_handle);
 }
 
 void
-cogl_program_attach_shader (COGLhandleARB program_handle,
-                            COGLhandleARB shader_handle)
+cogl_program_attach_shader (COGLhandle program_handle,
+                            COGLhandle shader_handle)
 {
   PROC (GLvoid,, glAttachObjectARB, GLhandleARB, GLhandleARB);
   proc (program_handle, shader_handle);
 }
 
 void
-cogl_program_link (COGLhandleARB program_handle)
+cogl_program_link (COGLhandle program_handle)
 {
   PROC (GLvoid,, glLinkProgramARB, GLhandleARB);
   proc (program_handle);
 }
 
 void
-cogl_program_use (COGLhandleARB program_handle)
+cogl_program_use (COGLhandle program_handle)
 {
   PROC (GLvoid,, glUseProgramObjectARB, GLhandleARB);
   proc (program_handle);
 }
 
 COGLint
-cogl_program_get_uniform_location (COGLhandleARB  program_handle,
-                                   const gchar   *uniform_name)
+cogl_program_get_uniform_location (COGLhandle   program_handle,
+                                   const gchar *uniform_name)
 {
   PROC (GLint,0, glGetUniformLocationARB, GLhandleARB, const GLcharARB *)
   return proc (program_handle, uniform_name);
 }
 
 void
-cogl_program_destroy (COGLhandleARB handle)
+cogl_program_destroy (COGLhandle handle)
 {
   PROC (GLvoid,, glDeleteObjectARB, GLhandleARB);
   proc (handle);
 }
 
 void
-cogl_shader_destroy (COGLhandleARB handle)
+cogl_shader_destroy (COGLhandle handle)
 {
   PROC (GLvoid,, glDeleteObjectARB, GLhandleARB);
   proc (handle);
 }
 
 void
-cogl_shader_get_info_log (COGLhandleARB handle,
-                          guint         size,
-                          gchar        *buffer)
+cogl_shader_get_info_log (COGLhandle  handle,
+                          guint       size,
+                          gchar      *buffer)
 {
   COGLint len;
   PROC (GLvoid,, glGetInfoLogARB, GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
@@ -888,9 +888,9 @@ cogl_shader_get_info_log (COGLhandleARB handle,
 }
 
 void
-cogl_shader_get_parameteriv (COGLhandleARB handle,
-                             COGLenum      pname,
-                             COGLint      *dest)
+cogl_shader_get_parameteriv (COGLhandle  handle,
+                             COGLenum    pname,
+                             COGLint    *dest)
 {
   PROC (GLvoid,, glGetObjectParameterivARB, GLhandleARB, GLenum, GLint*)
   proc (handle, pname, dest);
diff --git a/gles/cogl-defines.h b/gles/cogl-defines.h
index 925418fa5..83f2ae15d 100644
--- a/gles/cogl-defines.h
+++ b/gles/cogl-defines.h
@@ -440,7 +440,7 @@ G_BEGIN_DECLS
 typedef GLenum COGLenum;
 typedef GLint  COGLint;
 typedef GLuint COGLuint;
-typedef GLuint COGLhandleARB;
+typedef GLuint COGLhandle;
 
 /* extras */
 
diff --git a/gles/cogl.c b/gles/cogl.c
index 1a7131afd..378da38a6 100644
--- a/gles/cogl.c
+++ b/gles/cogl.c
@@ -645,73 +645,73 @@ cogl_fog_set (const ClutterColor *fog_color,
   glFogx (GL_FOG_END, (GLfixed) z_far);
 }
 
-COGLhandleARB
+COGLhandle
 cogl_create_program (void)
 {
   return 0;
 }
 
-COGLhandleARB
+COGLhandle
 cogl_create_shader (COGLenum shaderType)
 {
   return 0;
 }
 
 void
-cogl_shader_source (COGLhandleARB  shader,
+cogl_shader_source (COGLhandle  shader,
                     const gchar   *source)
 {
 }
 
 void
-cogl_shader_compile (COGLhandleARB shader_handle)
+cogl_shader_compile (COGLhandle shader_handle)
 {
 }
 
 void
-cogl_program_attach_shader (COGLhandleARB program_handle,
-                            COGLhandleARB shader_handle)
+cogl_program_attach_shader (COGLhandle program_handle,
+                            COGLhandle shader_handle)
 {
 }
 
 void
-cogl_program_link (COGLhandleARB program_handle)
+cogl_program_link (COGLhandle program_handle)
 {
 }
 
 void
-cogl_program_use (COGLhandleARB program_handle)
+cogl_program_use (COGLhandle program_handle)
 {
 }
 
 COGLint
-cogl_program_get_uniform_location (COGLhandleARB  program_handle,
-                                   const gchar   *uniform_name)
+cogl_program_get_uniform_location (COGLhandle   program_handle,
+                                   const gchar *uniform_name)
 {
   return 0;
 }
 
 void
-cogl_program_destroy (COGLhandleARB handle)
+cogl_program_destroy (COGLhandle handle)
 {
 }
 
 void
-cogl_shader_destroy (COGLhandleARB handle)
+cogl_shader_destroy (COGLhandle handle)
 {
 }
 
 void
-cogl_shader_get_info_log (COGLhandleARB  handle,
-                          guint          size,
-                          gchar         *buffer)
+cogl_shader_get_info_log (COGLhandle  handle,
+                          guint       size,
+                          gchar      *buffer)
 {
 }
 
 void
-cogl_shader_get_parameteriv (COGLhandleARB  handle,
-                             COGLenum       pname,
-                             COGLint       *dest)
+cogl_shader_get_parameteriv (COGLhandle  handle,
+                             COGLenum    pname,
+                             COGLint    *dest)
 {
 }