Fix building GLES 2 after the material branch merge

- In cogl-material.h it directly sets the values of the
  CoglMaterialLayerCombineFunc to some GL_* constants. However these
  aren't defined in GLES 2 beacuse it has no fixed function texture
  combining. Instead the CGL_* versions are now used. cogl-defines.h
  now sets these to either the GL_* version if it is available,
  otherwise it directly uses the number.

- Under GLES 2 cogl-material.c needs to access the CoglTexture struct
  so it needs to include cogl-texture-private.h

- There are now #define's in cogl-gles2-wrapper.h to remap the GL
  function names to the wrapper names. These are disabled in
  cogl-gles2-wrapper.c by defining COGL_GLES2_WRAPPER_NO_REMAP.

- Added missing wrappers for glLoadMatrixf and glMaterialfv.

- Renamed the TexEnvf wrapper to TexEnvi because the latter is used
  instead from the material API.
This commit is contained in:
Neil Roberts
2009-01-29 13:40:37 +00:00
parent a54d13368f
commit c50935edca
7 changed files with 297 additions and 77 deletions

View File

@@ -9,6 +9,7 @@
#include "cogl-handle.h"
#include "cogl-material-private.h"
#include "cogl-texture-private.h"
#include <glib.h>
#include <string.h>
@@ -18,7 +19,7 @@
*/
#ifdef HAVE_COGL_GLES2
#define glAlphaFunc cogl_wrap_glAlphaFunc
#include "../gles/cogl-gles2-wrapper.h"
#endif
static void _cogl_material_free (CoglMaterial *tex);

View File

@@ -159,14 +159,7 @@
#elif defined (HAVE_COGL_GLES2)
#define glVertexPointer cogl_wrap_glVertexPointer
#define glNormalPointer cogl_wrap_glNormalPointer
#define glTexCoordPointer cogl_wrap_glTexCoordPointer
#define glColorPointer cogl_wrap_glColorPointer
#define glDrawArrays cogl_wrap_glDrawArrays
#define glEnableClientState cogl_wrap_glEnableClientState
#define glDisableClientState cogl_wrap_glDisableClientState
#include "../gles/cogl-gles2-wrapper.h"
#endif