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 1323

Summary: Random garbage in window -- nothing updates (OpenGL)
Product: SDL Reporter: Vern Jensen <vern>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED ABANDONED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: shirishag75
Version: HG 2.0   
Hardware: x86   
OS: Windows (XP)   

Description Vern Jensen 2011-11-03 23:18:18 UTC
For build SDL-1.3.0-5605,

The documentation here:

http://wiki.libsdl.org/moin.cgi/SDL_GL_SetAttribute?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29%7C%28SGFunctions%29

states that SDL_GL_SetAttribute should be called before window creation. However, doing so on Windows Xp with SDL 1.3.0-5605 causes random garbage to appear in the window, and nothing is drawn/updated. Removing the SDL_GL_SetAttribute calls, OR putting them *after* context creation resolves the problem.

The problem is easily demonstrated with this sample code:

http://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL_(C_/_SDL)

Please note however that I modified this to work. To make it not work, move the SDL_GL_SetAttribute calls up prior to creating the window. (Or even prior to creating the GL context.) 

I'm fairly certain this happens even without the #include <GL3/gl3.h> header being used. However don't quote me on that.
Comment 1 Vern Jensen 2011-11-03 23:19:30 UTC
Note that this worked properly on MacOS X last time I tried it. however that might have been a slightly older version of SDL, not sure. It's on Windows XP that it exhibits this problem.
Comment 2 Ryan C. Gordon 2018-08-06 21:20:20 UTC
Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.