From 02b952394ae9efe9e80b803e671bca1b1f711a9a Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 24 Feb 2010 10:42:59 +0000 Subject: [PATCH] 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. --- clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c | 6 ++++++ clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c b/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c index f3a9e83b1..256e50532 100644 --- a/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c +++ b/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c @@ -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; diff --git a/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h b/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h index 33287e01d..021841597 100644 --- a/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h +++ b/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h @@ -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);