Fixes for building with --disable-gl

This fixes a few problems that occur when only using a GLES2 header.

• The use of GL_CLAMP_TO_BORDER and GL_MIRRORED_REPEAT were moved from
  cogl-pipelinelayer-state.h to cogl-sampler-cache-private.h but the
  corresponding defines were not.

• cogl-sampler-cache.c was using GL_TEXTURE_WRAP_R but this is only
  defined as GL_TEXTURE_WRAP_R_OES from the GLES2 header so it needs a
  #define.

• cogl-framebuffer-private.h uses GLuint but it does not include
  cogl-gl-header.h. It gets away with this when GLX support is enabled
  because the GL header would be included via glx.h.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 9cdb87c864fc262c4b26c13963670d60d7c18058)
This commit is contained in:
Neil Roberts 2012-05-08 15:53:25 +01:00 committed by Robert Bragg
parent 3dbe49acc3
commit 1d3d1732bd
4 changed files with 13 additions and 8 deletions

View File

@ -31,6 +31,7 @@
#include "cogl-winsys-private.h" #include "cogl-winsys-private.h"
#include "cogl-attribute-private.h" #include "cogl-attribute-private.h"
#include "cogl-offscreen.h" #include "cogl-offscreen.h"
#include "cogl-gl-header.h"
#ifdef COGL_HAS_XLIB_SUPPORT #ifdef COGL_HAS_XLIB_SUPPORT
#include <X11/Xlib.h> #include <X11/Xlib.h>

View File

@ -39,14 +39,6 @@
#include <glib.h> #include <glib.h>
/* This isn't defined in the GLES headers */
#ifndef GL_CLAMP_TO_BORDER
#define GL_CLAMP_TO_BORDER 0x812d
#endif
#ifndef GL_MIRRORED_REPEAT
#define GL_MIRRORED_REPEAT 0x8370
#endif
typedef struct _CoglPipelineLayer CoglPipelineLayer; typedef struct _CoglPipelineLayer CoglPipelineLayer;
#define COGL_PIPELINE_LAYER(OBJECT) ((CoglPipelineLayer *)OBJECT) #define COGL_PIPELINE_LAYER(OBJECT) ((CoglPipelineLayer *)OBJECT)

View File

@ -28,6 +28,14 @@
#include "cogl-context.h" #include "cogl-context.h"
#include "cogl-gl-header.h" #include "cogl-gl-header.h"
/* These aren't defined in the GLES headers */
#ifndef GL_CLAMP_TO_BORDER
#define GL_CLAMP_TO_BORDER 0x812d
#endif
#ifndef GL_MIRRORED_REPEAT
#define GL_MIRRORED_REPEAT 0x8370
#endif
/* GL_ALWAYS is just used here as a value that is known not to clash /* GL_ALWAYS is just used here as a value that is known not to clash
* with any valid GL wrap modes. * with any valid GL wrap modes.
* *

View File

@ -31,6 +31,10 @@
#include "cogl-sampler-cache-private.h" #include "cogl-sampler-cache-private.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"
#ifndef GL_TEXTURE_WRAP_R
#define GL_TEXTURE_WRAP_R 0x8072
#endif
struct _CoglSamplerCache struct _CoglSamplerCache
{ {
CoglContext *context; CoglContext *context;