summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopengl.h')
-rw-r--r--src/gui/opengl/qopengl.h53
1 files changed, 32 insertions, 21 deletions
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index e4e06ba284..0613527333 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -46,12 +46,35 @@
#include <QtCore/qglobal.h>
+// Note: Mac OSX is a "controlled platform" for OpenGL ABI so we
+// use the system provided headers there. Controlled means that the
+// headers always match the actual driver implementation so there
+// is no possibility of drivers exposing additional functionality
+// from the system headers. Also it means that the vendor can
+// (and does) make different choices about some OpenGL types. For
+// e.g. Apple uses void* for GLhandleARB whereas other platforms
+// use unsigned int.
+//
+// For the "uncontrolled" Windows and Linux platforms we use the
+// official Khronos headers. On these platforms this gives
+// access to additional functionality the drivers may expose but
+// which the system headers do not.
+
#if defined(QT_OPENGL_ES_2)
# if defined(Q_OS_MAC)
# include <OpenGLES/ES2/gl.h>
-# else
+# include <OpenGLES/ES2/glext.h>
+
+/*
+ OES_EGL_image_external is not included in the Apple provided
+ system headers yet, but we define the missing typedef so that
+ the qopenglextensions.cpp code will magically work once Apple
+ include the extension in their drivers.
+*/
+typedef void* GLeglImageOES;
+
+# else // "uncontrolled" platforms
# include <GLES2/gl2.h>
-# endif
/*
Some GLES2 implementations (like the one on Harmattan) are missing the
@@ -61,27 +84,15 @@
*/
typedef char GLchar;
-# include <QtGui/qopengles2ext.h>
-# ifndef GL_DOUBLE
-# define GL_DOUBLE GL_FLOAT
-# endif
-# ifndef GLdouble
+# include <QtGui/qopengles2ext.h>
+# ifndef GL_DOUBLE
+# define GL_DOUBLE GL_FLOAT
+# endif
+# ifndef GLdouble
typedef GLfloat GLdouble;
-# endif
+# endif
+# endif // Q_OS_MAC
#else
-// Mac OSX is a "controlled platform" for OpenGL ABI so we use
-// the system provided headers there. Controlled means that the
-// headers always match the actual driver implementation so there
-// is no possibility of drivers exposing additional functionality
-// from the system headers. Also it means that the vendor can
-// (and does) make different choices about some OpenGL types. For
-// e.g. Apple uses void* for GLhandleARB whereas other platforms
-// use unsigned int.
-//
-// For the "uncontrolled" Windows and Linux platforms we use the
-// official Khronos glext.h header. On these platforms this gives
-// access to additional functionality the drivers may expose but
-// which the system headers do not.
# if defined(Q_OS_MAC)
# include <OpenGL/gl.h>
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7