Public headers should not have #ifdefs relying on private defines

HAVE_COGL_GLES2 is defined in config.h through the configure script and
should not be used in public headers.

The patch makes configure generate the right define that can be used
later in the header.
This commit is contained in:
Damien Lespiau 2009-06-15 14:15:27 +01:00
parent c6fba47a52
commit 3653a9a64d
2 changed files with 7 additions and 2 deletions

View File

@ -31,6 +31,8 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define @COGL_GLES_VERSION@ 1
/* ClearBufferMask */ /* ClearBufferMask */
#define CGL_DEPTH_BUFFER_BIT GL_DEPTH_BUFFER_BIT #define CGL_DEPTH_BUFFER_BIT GL_DEPTH_BUFFER_BIT
#define CGL_STENCIL_BUFFER_BIT GL_STENCIL_BUFFER_BIT #define CGL_STENCIL_BUFFER_BIT GL_STENCIL_BUFFER_BIT
@ -163,7 +165,7 @@ G_BEGIN_DECLS
#define CGL_STENCIL_PASS_DEPTH_PASS GL_STENCIL_PASS_DEPTH_PASS #define CGL_STENCIL_PASS_DEPTH_PASS GL_STENCIL_PASS_DEPTH_PASS
#define CGL_STENCIL_REF GL_STENCIL_REF #define CGL_STENCIL_REF GL_STENCIL_REF
#define CGL_STENCIL_WRITEMASK GL_STENCIL_WRITEMASK #define CGL_STENCIL_WRITEMASK GL_STENCIL_WRITEMASK
#ifdef HAVE_COGL_GLES2 #ifdef COGL_HAS_GLES2
#define CGL_MATRIX_MODE 0x0BA0 /* bad style but works for now */ #define CGL_MATRIX_MODE 0x0BA0 /* bad style but works for now */
#else #else
#define CGL_MATRIX_MODE GL_MATRIX_MODE #define CGL_MATRIX_MODE GL_MATRIX_MODE
@ -195,7 +197,7 @@ G_BEGIN_DECLS
#define CGL_MAX_VIEWPORT_DIMS GL_MAX_VIEWPORT_DIMS #define CGL_MAX_VIEWPORT_DIMS GL_MAX_VIEWPORT_DIMS
#define CGL_MAX_ELEMENTS_VERTICES GL_MAX_ELEMENTS_VERTICES #define CGL_MAX_ELEMENTS_VERTICES GL_MAX_ELEMENTS_VERTICES
#define CGL_MAX_ELEMENTS_INDICES GL_MAX_ELEMENTS_INDICES #define CGL_MAX_ELEMENTS_INDICES GL_MAX_ELEMENTS_INDICES
#ifdef HAVE_COGL_GLES2 #ifdef COGL_HAS_GLES2
#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS #define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
#else #else
#define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_TEXTURE_UNITS #define CGL_MAX_COMBINED_TEXTURE_IMAGE_UNITS GL_MAX_TEXTURE_UNITS

View File

@ -135,6 +135,7 @@ AS_IF([test "x$clutterbackend" = "xeglnative" ||
CLUTTER_COGL="gles" CLUTTER_COGL="gles"
AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering])
AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1])
AC_CHECK_HEADERS([GLES/egl.h], AC_CHECK_HEADERS([GLES/egl.h],
[], [],
@ -179,6 +180,7 @@ AS_IF([test "x$clutterbackend" = "xeglnative" ||
use_gles2_wrapper=yes use_gles2_wrapper=yes
CLUTTER_COGL="gles" CLUTTER_COGL="gles"
AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GL/ES for rendering]) AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GL/ES for rendering])
AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES2])
AC_CHECK_HEADERS([EGL/egl.h], AC_CHECK_HEADERS([EGL/egl.h],
[], [],
@ -192,6 +194,7 @@ AS_IF([test "x$clutterbackend" = "xeglnative" ||
clutter_gl_header="GLES/gl.h" clutter_gl_header="GLES/gl.h"
CLUTTER_COGL="gles" CLUTTER_COGL="gles"
AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering])
AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1])
AC_CHECK_HEADERS([GLES/egl.h], AC_CHECK_HEADERS([GLES/egl.h],
[], [],