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 - NO_SDL_GLEXT should prevent OS glext.h as well
Summary: NO_SDL_GLEXT should prevent OS glext.h as well
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 01:58 UTC by Jørgen Tjernø
Modified: 2014-06-16 00:38 UTC (History)
0 users

See Also:


Attachments
Simple fix (634 bytes, patch)
2014-06-03 02:06 UTC, Jørgen Tjernø
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.