gles/cogl-shader.c: Store the shader type in CoglShader
authorNeil Roberts <neil@linux.intel.com>
Wed, 14 Jul 2010 18:39:24 +0000 (19:39 +0100)
committerNeil Roberts <neil@linux.intel.com>
Thu, 22 Jul 2010 21:22:23 +0000 (22:22 +0100)
Nothing was storing the shader type when a shader was created so it
would get confused about whether it was a custom vertex or fragment
shader.

Also the 'type' member of CoglShader was a GLenum but the only place
that read it was treating it as if it was CoglShaderType. This changes
it be CoglShaderType.

clutter/cogl/cogl/driver/gles/cogl-shader-private.h
clutter/cogl/cogl/driver/gles/cogl-shader.c

index cf00c48..878ab55 100644 (file)
@@ -32,7 +32,7 @@ struct _CoglShader
 {
   CoglHandleObject   _parent;
   GLuint             gl_handle;
-  GLenum             type;
+  CoglShaderType     type;
 };
 
 CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle);
index 5b2214e..a86104d 100644 (file)
@@ -69,6 +69,7 @@ cogl_create_shader (CoglShaderType type)
 
   shader = g_slice_new (CoglShader);
   shader->gl_handle = glCreateShader (gl_type);
+  shader->type = type;
 
   return _cogl_shader_handle_new (shader);
 }