Commit 02b95239 authored by Neil Roberts's avatar Neil Roberts

gles2: Implement a wrapper for glGetIntegerv(GL_MAX_TEXTURE_UNITS)

The GLES2 backend for Cogl is failing to compile because
GL_MAX_TEXTURE_UNITS is not defined. Let's define it and provide a
wrapper which uses GL_MAX_TEXTURE_IMAGE_UNITS or
COGL_GLES2_MAX_TEXTURE_UNITS, whichever is the smallest.
parent 3bc0672f
......@@ -1285,6 +1285,12 @@ cogl_wrap_glGetIntegerv (GLenum pname, GLint *params)
*params = w->matrix_mode;
break;
case GL_MAX_TEXTURE_UNITS:
glGetIntegerv (GL_MAX_TEXTURE_IMAGE_UNITS, params);
if (*params > COGL_GLES2_MAX_TEXTURE_UNITS)
*params = COGL_GLES2_MAX_TEXTURE_UNITS;
break;
default:
glGetIntegerv (pname, params);
break;
......
......@@ -301,6 +301,8 @@ struct _CoglGles2WrapperShader
#define GL_EMISSION 0x1600
#define GL_SHININESS 0x1601
#define GL_MAX_TEXTURE_UNITS 0x84e2
#endif /* GL_MODELVIEW */
void cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment