diff --git a/doc/changelog.dox b/doc/changelog.dox index 3c430486a..5abaf9705 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -264,6 +264,9 @@ See also: for Emscripten (see [mosra/magnum#219](https://github.com/mosra/magnum/issues/219)) - Updated the Vcpkg package to work correctly with Vcpkg's own SDL2 (see [Microsoft/vcpkg#5730](https://github.com/Microsoft/vcpkg/pull/5730)) +- Updated bundled GL headers to properly define the `GL_VERSION_*` macros to + avoid conflicting `GLintptr` and `GLsizeiptr` type definitions on Windows + when using Magnum together with Qt @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index cdc1b6ae2..7d36f26e3 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -93,6 +93,29 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +#define GL_VERSION_1_0 1 +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_VERSION_1_4 1 +#define GL_VERSION_1_5 1 +#define GL_VERSION_2_0 1 +#define GL_VERSION_2_1 1 +#define GL_VERSION_3_0 1 +#define GL_VERSION_3_1 1 +#define GL_VERSION_3_2 1 +#define GL_VERSION_3_3 1 +#define GL_VERSION_4_0 1 +#define GL_VERSION_4_1 1 +#define GL_VERSION_4_2 1 +#define GL_VERSION_4_3 1 +#define GL_VERSION_4_4 1 +#define GL_VERSION_4_5 1 +#define GL_VERSION_4_6 1 + /* Data types */ #include diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h.template b/src/MagnumExternal/OpenGL/GL/flextGL.h.template index a9217af6c..471ff1a12 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h.template +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h.template @@ -94,6 +94,15 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +@for cat,_ in functions: +@if cat.startswith('VERSION_'): +#define GL_@cat 1 +@endif +@end + /* Data types */ @passthru diff --git a/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template b/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template index 0849a6079..ac895ef8b 100644 --- a/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template +++ b/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template @@ -56,6 +56,15 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +@for cat,_ in functions: +@if cat.startswith('ES_VERSION_'): +#define GL_@cat 1 +@endif +@end + /* Data types */ @passthru diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index f8a72db4a..e4f36bada 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -80,6 +80,11 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +#define GL_ES_VERSION_2_0 1 + /* Data types */ #include diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template b/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template index b465c2740..751c3a1d2 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template @@ -81,6 +81,15 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +@for cat,_ in functions: +@if cat.startswith('ES_VERSION_'): +#define GL_@cat 1 +@endif +@end + /* Data types */ @passthru diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h b/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h index eb47a02cd..6e42e6d2a 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h @@ -55,6 +55,11 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +#define GL_ES_VERSION_2_0 1 + /* Data types */ #include diff --git a/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template b/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template index fbf2a7d73..d0c9e79c4 100644 --- a/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template +++ b/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template @@ -61,6 +61,15 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +@for cat,_ in functions: +@if cat.startswith('ES_VERSION_'): +#define GL_@cat 1 +@endif +@end + /* Data types */ @passthru diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index c83e6ba00..49e585fad 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -84,6 +84,14 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +#define GL_ES_VERSION_2_0 1 +#define GL_ES_VERSION_3_0 1 +#define GL_ES_VERSION_3_1 1 +#define GL_ES_VERSION_3_2 1 + /* Data types */ #include diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template b/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template index 9b58f8fd0..a16222d75 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template @@ -85,6 +85,15 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +@for cat,_ in functions: +@if cat.startswith('ES_VERSION_'): +#define GL_@cat 1 +@endif +@end + /* Data types */ @passthru diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h b/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h index 77fc47a79..a1b157382 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h @@ -60,6 +60,12 @@ void flextGLInit(Magnum::GL::Context& context); #define GLAPI extern #endif +/* GL version defines. Needs to be done to avoid conflicting definitions with + other GL headers (such as qopengl.h in Qt, which has different definition + for GLsizei and GLintptr on Windows) */ +#define GL_ES_VERSION_2_0 1 +#define GL_ES_VERSION_3_0 1 + /* Data types */ #include