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 1107 - SDL_WINDOWEVENT_RESIZED doesn't restore GL context
Summary: SDL_WINDOWEVENT_RESIZED doesn't restore GL context
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86 Mac OS X 10.6
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 14:59 UTC by Vern Jensen
Modified: 2011-02-16 14:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vern Jensen 2011-01-25 14:59:19 UTC
Previously, using an older version of SDL 1.3 from May 2010, I had no trouble with this. But with the latest SDL 1.3-5080, I've found I must call SDL_GL_MakeCurrent() after I get an SDL_WINDOWEVENT_RESIZED event, prior to making glViewport() or whatnot calls, otherwise those calls will have no effect.

Maybe SDL should automatically restore the GL context to what it was prior to issuing the resize event? (Particularly if there was only one context.) Or, at a minimum, add documentation for SDL_WINDOWEVENT_RESIZED that makes it clear the user must restore the GL context before making GL calls after receiving this event.
Comment 1 Sam Lantinga 2011-02-16 03:17:53 UTC
I just did a bunch of work with the OpenGL context management and resizing.  Can you try this with the latest snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!
Comment 2 Vern Jensen 2011-02-16 14:00:38 UTC
Yes, SDL now restores the GL context properly.
Comment 3 Sam Lantinga 2011-02-16 14:20:27 UTC
Great! :)