[Cogl] [PATCH 1/2] Fixes for building with --disable-gl

Robert Bragg robert at sixbynine.org
Tue May 8 12:41:00 PDT 2012


This looks good to me:

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

Regards,
Robert
On May 8, 2012 6:34 PM, "Neil Roberts" <neil at linux.intel.com> wrote:

> 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.
> ---
>  cogl/cogl-framebuffer-private.h    |    1 +
>  cogl/cogl-pipeline-layer-private.h |    8 --------
>  cogl/cogl-sampler-cache-private.h  |    8 ++++++++
>  cogl/cogl-sampler-cache.c          |    4 ++++
>  4 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/cogl/cogl-framebuffer-private.h
> b/cogl/cogl-framebuffer-private.h
> index 856f909..4c95f73 100644
> --- a/cogl/cogl-framebuffer-private.h
> +++ b/cogl/cogl-framebuffer-private.h
> @@ -31,6 +31,7 @@
>  #include "cogl-winsys-private.h"
>  #include "cogl-attribute-private.h"
>  #include "cogl-offscreen.h"
> +#include "cogl-gl-header.h"
>
>  #ifdef COGL_HAS_XLIB_SUPPORT
>  #include <X11/Xlib.h>
> diff --git a/cogl/cogl-pipeline-layer-private.h
> b/cogl/cogl-pipeline-layer-private.h
> index b672473..84ccd9d 100644
> --- a/cogl/cogl-pipeline-layer-private.h
> +++ b/cogl/cogl-pipeline-layer-private.h
> @@ -39,14 +39,6 @@
>
>  #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;
>  #define COGL_PIPELINE_LAYER(OBJECT) ((CoglPipelineLayer *)OBJECT)
>
> diff --git a/cogl/cogl-sampler-cache-private.h
> b/cogl/cogl-sampler-cache-private.h
> index 4eb7503..0149751 100644
> --- a/cogl/cogl-sampler-cache-private.h
> +++ b/cogl/cogl-sampler-cache-private.h
> @@ -28,6 +28,14 @@
>  #include "cogl-context.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
>  * with any valid GL wrap modes.
>  *
> diff --git a/cogl/cogl-sampler-cache.c b/cogl/cogl-sampler-cache.c
> index b7bb4da..f91983c 100644
> --- a/cogl/cogl-sampler-cache.c
> +++ b/cogl/cogl-sampler-cache.c
> @@ -31,6 +31,10 @@
>  #include "cogl-sampler-cache-private.h"
>  #include "cogl-context-private.h"
>
> +#ifndef GL_TEXTURE_WRAP_R
> +#define GL_TEXTURE_WRAP_R 0x8072
> +#endif
> +
>  struct _CoglSamplerCache
>  {
>   CoglContext *context;
> --
> 1.7.3.16.g9464b
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20120508/5bc932c7/attachment.html>


More information about the Cogl mailing list