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)
This commit is contained in:
parent
a749c7c1ab
commit
9a242832dc
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user