[cogl/cogl-1.14] Add some defines that are missing on GLES



commit 9a242832dccec13b1e756d251bb331b9c2f86e4b
Author: Neil Roberts <neil linux intel com>
Date:   Thu Jan 24 11:41:38 2013 +0000

    Add some defines that are missing on GLES
    
    The GLES2 driver wasn't compiling unless the GL driver is also enabled
    because some run-time conditional code was directly using GL-only
    defines.
    
    This should also fix compiling using the stock GL headers on OSÂX
    which don't define GL_NUM_EXTENSIONS.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692420
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit 661e1719aa0b95c409c568ec91ea52b8ff90519b)

 cogl/cogl-context.c |    8 +++++++-
 cogl/cogl-texture.c |    5 +++++
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
index 6dff50c..6e03673 100644
--- a/cogl/cogl-context.c
+++ b/cogl/cogl-context.c
@@ -58,11 +58,15 @@
 #include "cogl-pipeline-fragend-arbfp-private.h"
 #endif
 
-/* This isn't defined in the GLES headers */
+/* These aren't defined in the GLES headers */
 #ifndef GL_POINT_SPRITE
 #define GL_POINT_SPRITE 0x8861
 #endif
 
+#ifndef GL_NUM_EXTENSIONS
+#define GL_NUM_EXTENSIONS 0x821D
+#endif
+
 static void _cogl_context_free (CoglContext *context);
 
 COGL_OBJECT_DEFINE (Context, context);
@@ -649,6 +653,7 @@ _cogl_context_get_gl_extensions (CoglContext *context)
 
   /* In GL 3, querying GL_EXTENSIONS is deprecated so we have to build
    * the array using glGetStringi instead */
+#ifdef HAVE_COGL_GL
   if (context->driver == COGL_DRIVER_GL3)
     {
       int num_extensions, i;
@@ -667,6 +672,7 @@ _cogl_context_get_gl_extensions (CoglContext *context)
       ret[num_extensions] = NULL;
     }
   else
+#endif
     {
       const char *all_extensions =
         (const char *) context->glGetString (GL_EXTENSIONS);
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 4ea6eb3..eeadd5f 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -61,6 +61,11 @@
 #include <stdlib.h>
 #include <math.h>
 
+/* This isn't defined in the GLES headers */
+#ifndef GL_RED
+#define GL_RED 0x1903
+#endif
+
 uint32_t
 cogl_texture_error_quark (void)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]