summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengl.h
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2013-03-14 17:11:52 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-15 13:30:32 +0100
commit379886d24b9b0a88930dc479db2217c15381814f (patch)
treec929105e4742a82024a6ba1a120b09fac2f1d093 /src/gui/opengl/qopengl.h
parent1a60bfdcd1260aad8e8daeb117d4526970aa8228 (diff)
Fix calling convention in ANGLE builds on Windows
Desktop OpenGL builds on windows correctly define APIENTRY whereas at present the ES2 (ANGLE) builds do not. This leads to QOPENGLF_APIENTRY having the wrong calling convention. This fix is required for https://codereview.qt-project.org/#change,48660 but may also fix any random crashes that people may be seeing with other Qt-wrapped OpenGL functions in ANGLE builds. Change-Id: I8068c181d41be949d29168bd5ca1a181cc2245c7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/opengl/qopengl.h')
-rw-r--r--src/gui/opengl/qopengl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index 0613527333..c5bff90d2a 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -46,6 +46,11 @@
#include <QtCore/qglobal.h>
+// Windows always needs this to ensure that APIENTRY gets defined
+#if defined(Q_OS_WIN)
+# include <QtCore/qt_windows.h>
+#endif
+
// 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
@@ -101,9 +106,6 @@ typedef GLfloat GLdouble;
# endif
# include <OpenGL/glext.h>
# else
-# if defined(Q_OS_WIN)
-# include <QtCore/qt_windows.h>
-# endif
# define GL_GLEXT_LEGACY // Prevents GL/gl.h form #including system glext.h
# include <GL/gl.h>
# include <QtGui/qopenglext.h>