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.
This commit is contained in:
Neil Roberts 2010-02-24 10:42:59 +00:00
parent 984c19a6f7
commit 7dce5d9372
2 changed files with 8 additions and 0 deletions

View File

@ -1285,6 +1285,12 @@ cogl_wrap_glGetIntegerv (GLenum pname, GLint *params)
*params = w->matrix_mode; *params = w->matrix_mode;
break; 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: default:
glGetIntegerv (pname, params); glGetIntegerv (pname, params);
break; break;

View File

@ -301,6 +301,8 @@ struct _CoglGles2WrapperShader
#define GL_EMISSION 0x1600 #define GL_EMISSION 0x1600
#define GL_SHININESS 0x1601 #define GL_SHININESS 0x1601
#define GL_MAX_TEXTURE_UNITS 0x84e2
#endif /* GL_MODELVIEW */ #endif /* GL_MODELVIEW */
void cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper); void cogl_gles2_wrapper_init (CoglGles2Wrapper *wrapper);