diff options
Diffstat (limited to 'src/gui/opengl/qopengl.h')
-rw-r--r-- | src/gui/opengl/qopengl.h | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index ef5ab9aa65..56e99ee8b8 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -67,8 +67,13 @@ #if defined(QT_OPENGL_ES_2) # if defined(Q_OS_MAC) // iOS -# include <OpenGLES/ES2/gl.h> -# include <OpenGLES/ES2/glext.h> +# if defined(QT_OPENGL_ES_3) +# include <OpenGLES/ES3/gl.h> +# include <OpenGLES/ES3/glext.h> +# else +# include <OpenGLES/ES2/gl.h> +# include <OpenGLES/ES2/glext.h> +# endif /* OES_EGL_image_external is not included in the Apple provided @@ -79,7 +84,28 @@ typedef void* GLeglImageOES; # else // "uncontrolled" ES2 platforms -# include <GLES2/gl2.h> + +// In "es2" builds (QT_OPENGL_ES_2) additional defines indicate if ES +// 3.0 or higher is available. In this case include the corresponding +// header. These are backwards compatible and it should be safe to +// include headers on top of each other, meaning that applications can +// include gl2.h even if gl31.h gets included here. + +// This compile time differentation is important inside Qt because, +// unlike desktop GL, GLES is different when it comes to versioning +// and extensions: Standard functions that are new in a given version +// are always available in a version-specific header and are not +// guaranteed to be dynamically resolvable via eglGetProcAddress (and +// are typically not available as extensions even if they were part of +// an extension for a previous version). + +# if defined(QT_OPENGL_ES_3_1) +# include <GLES3/gl31.h> +# elif defined(QT_OPENGL_ES_3) +# include <GLES3/gl3.h> +# else +# include <GLES2/gl2.h> +#endif /* Some GLES2 implementations (like the one on Harmattan) are missing the @@ -91,12 +117,6 @@ typedef char GLchar; # include <QtGui/qopengles2ext.h> # endif // Q_OS_MAC -# ifndef GL_DOUBLE -# define GL_DOUBLE GL_FLOAT -# endif -# ifndef GLdouble -typedef GLfloat GLdouble; -# endif #else // non-ES2 platforms # if defined(Q_OS_MAC) # include <OpenGL/gl.h> @@ -239,7 +259,7 @@ struct _cl_event; #endif #ifndef GL_ARB_debug_output -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); #endif #ifndef GL_AMD_debug_output @@ -247,7 +267,7 @@ typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severit #endif #ifndef GL_KHR_debug -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); #endif #ifndef GL_NV_vdpau_interop |