Browse Source

external: provide the GL_VERSION_* defines in our GL headers.

This fixes a conflicting definition of GLsizeiptr and GLintptr when
Magnum is combined with qopengl.h from Qt on Windows. Khronos has it as
`signed long int`, whereas qopengl.h as ptrdiff_t, which is just `int`.
pull/335/head
Vladimír Vondruš 7 years ago
parent
commit
522db683a9
  1. 3
      doc/changelog.dox
  2. 23
      src/MagnumExternal/OpenGL/GL/flextGL.h
  3. 9
      src/MagnumExternal/OpenGL/GL/flextGL.h.template
  4. 9
      src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template
  5. 5
      src/MagnumExternal/OpenGL/GLES2/flextGL.h
  6. 9
      src/MagnumExternal/OpenGL/GLES2/flextGL.h.template
  7. 5
      src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h
  8. 9
      src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template
  9. 8
      src/MagnumExternal/OpenGL/GLES3/flextGL.h
  10. 9
      src/MagnumExternal/OpenGL/GLES3/flextGL.h.template
  11. 6
      src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h

3
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

23
src/MagnumExternal/OpenGL/GL/flextGL.h vendored

@ -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 <KHR/khrplatform.h>

9
src/MagnumExternal/OpenGL/GL/flextGL.h.template vendored

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

9
src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template vendored

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

5
src/MagnumExternal/OpenGL/GLES2/flextGL.h vendored

@ -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 <KHR/khrplatform.h>

9
src/MagnumExternal/OpenGL/GLES2/flextGL.h.template vendored

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

5
src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h vendored

@ -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 <KHR/khrplatform.h>

9
src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template vendored

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

8
src/MagnumExternal/OpenGL/GLES3/flextGL.h vendored

@ -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 <KHR/khrplatform.h>

9
src/MagnumExternal/OpenGL/GLES3/flextGL.h.template vendored

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

6
src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h vendored

@ -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 <KHR/khrplatform.h>

Loading…
Cancel
Save