gles/cogl-shader.c: Store the shader type in CoglShader

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.
This commit is contained in:
Neil Roberts 2010-07-14 19:39:24 +01:00
parent 023510636c
commit a2c2797105
2 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,7 @@ struct _CoglShader
{ {
CoglHandleObject _parent; CoglHandleObject _parent;
GLuint gl_handle; GLuint gl_handle;
GLenum type; CoglShaderType type;
}; };
CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle); CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle);

View File

@ -69,6 +69,7 @@ cogl_create_shader (CoglShaderType type)
shader = g_slice_new (CoglShader); shader = g_slice_new (CoglShader);
shader->gl_handle = glCreateShader (gl_type); shader->gl_handle = glCreateShader (gl_type);
shader->type = type;
return _cogl_shader_handle_new (shader); return _cogl_shader_handle_new (shader);
} }