Fixed bug 2568 - NO_SDL_GLEXT should prevent OS glext.h as well
authorSam Lantinga <slouken@libsdl.org>
Sun, 15 Jun 2014 17:37:35 -0700
changeset 886855b16e3a3fc4
parent 8867 540acbf32d5b
child 8869 553e9f7cd10e
Fixed bug 2568 - NO_SDL_GLEXT should prevent OS glext.h as well

Jørgen Tjernø

If you #define NO_SDL_GLEXT before including SDL_opengl.h, it still includes the platform-provided glext.h. The comments indicate that this define is intended to be used when you provide your own glext.h (quote from SDL_opengl.h: "Define this if you have your own version of glext.h and want to disable the version included in SDL_opengl.h.")

This is a problem because glext.h depends on the contents of gl.h, and it's practical to let SDL_opengl.h pick the right #include for gl.h for our platform.
include/SDL_opengl.h
     1.1 --- a/include/SDL_opengl.h	Sun Jun 15 17:26:30 2014 -0700
     1.2 +++ b/include/SDL_opengl.h	Sun Jun 15 17:37:35 2014 -0700
     1.3 @@ -45,8 +45,8 @@
     1.4  #ifdef __glext_h_
     1.5  /* Someone has already included glext.h */
     1.6  #define NO_SDL_GLEXT
     1.7 -#endif
     1.8 -#ifndef NO_SDL_GLEXT
     1.9 +#else
    1.10 +#define _SDL_CLEAR_GLEXT_HEADERGUARD
    1.11  #define __glext_h_              /* Don't let gl.h include glext.h */
    1.12  #endif
    1.13  #if defined(__MACOSX__)
    1.14 @@ -55,7 +55,7 @@
    1.15  #else
    1.16  #include <GL/gl.h>              /* Header File For The OpenGL Library */
    1.17  #endif
    1.18 -#ifndef NO_SDL_GLEXT
    1.19 +#ifdef _SDL_CLEAR_GLEXT_HEADERGUARD
    1.20  #undef __glext_h_
    1.21  #endif
    1.22