We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2568

Summary: NO_SDL_GLEXT should prevent OS glext.h as well
Product: SDL Reporter: Jørgen Tjernø <jorgen>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: All   
Attachments: Simple fix

Description Jørgen Tjernø 2014-06-03 01:58:14 UTC
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.

The workaround is to #define __glext_h_ before you #include <SDL_opengl.h>, then #undef __glext_h_ and #include your own glext.h.
Comment 1 Jørgen Tjernø 2014-06-03 02:06:15 UTC
Created attachment 1668 [details]
Simple fix

I believe this is a simple oversight, and here's a patch that should fix it.
Comment 2 Sam Lantinga 2014-06-16 00:38:53 UTC
This is in, thanks!
https://hg.libsdl.org/SDL/rev/55b16e3a3fc4

This may cause behavior changes for some applications, but the workaround is to simply include glext.h in your application.