]> git.cworth.org Git - apitrace/commitdiff
gles: Include GLES headers in eglimports.hpp
authorChia-I Wu <olvaffe@gmail.com>
Wed, 2 Nov 2011 13:12:51 +0000 (21:12 +0800)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 17 Nov 2011 15:50:25 +0000 (15:50 +0000)
They are always included to make sure we have GLES types and enums defined.
This allows us to treat GLES effectively as an extension to GL, without having
to put #ifdef's at multiple places.

eglimports.hpp

index a6d53cc9c2afc70669977840588d9ead233c2da2..2fd1e0a07f084d2e69424f3ce8c85f6681c17401 100644 (file)
 /* Prevent collision with Trace::Bool */
 #undef Bool
 
-#endif /* HAVE_EGL */
+
+// OpenGL ES
+#include <GLES/glplatform.h>
+#include <GLES2/gl2platform.h>
+
+#else // HAVE_EGL
+
+// We always include GLES headers below to have the types and enums defined.
+// For that to work without GLES platform headers, we need to define GL_API,
+// GL_APICALL, and GL_APIENTRY.  It does not matter what they are defined to.
+// When we hit here, EGL/GLES support is disabled and all we need from the
+// headers are the types and enums.
+
+#ifndef GL_API
+#define GL_API GLAPI
+#endif
+
+#ifndef GL_APICALL
+#define GL_APICALL GLAPI
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY APIENTRY
+#endif
+
+#endif // HAVE_EGL
+
+
+// OpenGL ES 1.1
+typedef int32_t  GLfixed;
+typedef int32_t  GLclampx;
+
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES                                    0x8B90
+#define GL_PALETTE4_RGBA8_OES                                   0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES                                0x8B92
+#define GL_PALETTE4_RGBA4_OES                                   0x8B93
+#define GL_PALETTE4_RGB5_A1_OES                                 0x8B94
+#define GL_PALETTE8_RGB8_OES                                    0x8B95
+#define GL_PALETTE8_RGBA8_OES                                   0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES                                0x8B97
+#define GL_PALETTE8_RGBA4_OES                                   0x8B98
+#define GL_PALETTE8_RGB5_A1_OES                                 0x8B99
+#endif
+
+#ifndef GL_OES_point_size_array
+#define GL_POINT_SIZE_ARRAY_OES                                 0x8B9C
+#define GL_POINT_SIZE_ARRAY_TYPE_OES                            0x898A
+#define GL_POINT_SIZE_ARRAY_STRIDE_OES                          0x898B
+#define GL_POINT_SIZE_ARRAY_POINTER_OES                         0x898C
+#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES                  0x8B9F
+extern "C" GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#undef __glext_h_
+#include "GLES/glext.h"
+
+
+// OpenGL ES 2.0
+
+// avoid conflicting with GL_NV_multisample_coverage
+#define GL_NV_coverage_sample
+#include "GLES2/gl2ext.h"
 
 
 #endif /* _EGLIMPORTS_HPP_ */