aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2011-09-05 10:44:58 +0800
committerPaul Berry <stereotype441@gmail.com>2011-09-09 11:21:48 -0700
commit602f7a3a5d4d456a2f371ceeff0f3da4eded62b7 (patch)
tree0830691c24ddc9f99c81b2d5f9a093d25ba78239 /src
parentd6cfe15bfe4b76deceec3235b777225afd021e7e (diff)
downloadpiglit-602f7a3a5d4d456a2f371ceeff0f3da4eded62b7.tar.gz
piglit: add defines to gl_wrap.h to improve portability
Define GL_TEXTURE_CUBE_MAP_* to GL_TEXTURE_CUBE_MAP_*_OES for GLES1. This should help us port piglit-util.c or some of the cubemap tests to GLES1 without or with less #ifdef ugliness. Also make sure we cannot include more than one set of headers from GL, GLES1, and GLES2 headers. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/piglit/gl_wrap.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/piglit/gl_wrap.h b/src/piglit/gl_wrap.h
index dc0afe87..8fddd2f0 100644
--- a/src/piglit/gl_wrap.h
+++ b/src/piglit/gl_wrap.h
@@ -42,7 +42,7 @@ extern "C" {
#include <windows.h>
#endif
-#ifdef USE_OPENGL
+#if defined(USE_OPENGL)
# include "glew.h"
/* Include the real headers too, in case GLEW misses something. */
# ifdef __APPLE__
@@ -54,14 +54,20 @@ extern "C" {
# include <GL/glu.h>
# include <GL/glext.h>
# endif
-#endif
-#ifdef USE_OPENGL_ES1
+#elif defined(USE_OPENGL_ES1)
# include <GLES/gl.h>
# include <GLES/glext.h>
-#endif
-#ifdef USE_OPENGL_ES2
+ /* for source level compatibility */
+# define GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES
+# define GL_TEXTURE_CUBE_MAP_POSITIVE_Y GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES
+# define GL_TEXTURE_CUBE_MAP_POSITIVE_Z GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES
+# define GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES
+# define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
+# define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
+
+#elif defined(USE_OPENGL_ES2)
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
#endif