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>
This commit is contained in:
Sean Harmer 2013-03-14 17:11:52 +00:00 committed by The Qt Project
parent 1a60bfdcd1
commit 379886d24b

View File

@ -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>