summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengl.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-03-13 13:07:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-13 18:40:26 +0100
commitc9eb0f9b49e825500f3aace1b84e3e4b143cb98d (patch)
treef52271925f66e84d4c788b3a8431a81a83805eae /src/gui/opengl/qopengl.h
parent696281bf082da5ea33a02c7c1d372a40f170add6 (diff)
Don't include custom qopengles2ext.h on iOS
This fixes the build after ec9c0faefd (Update gl2ext.h with the latest version from Khronos). Just like Mac OS X, iOS is a controlled platform, and we should include the system headers instead. The OES_EGL_image_external extension is not yet in the system headers though, so we provide our own typedef to make the qopenglextensions.cpp code build, and the extension will work out of the box once Apple includes driver support for it. Change-Id: Ib6ba09d400ba38f05d91c90d4c9e54a8626889e1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
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