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 630 - No SDL_GL_UnloadLibrary() available.
Summary: No SDL_GL_UnloadLibrary() available.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 API change
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-23 15:29 UTC by Ryan C. Gordon
Modified: 2009-02-16 20:39 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 Ryan C. Gordon 2008-09-23 15:29:57 UTC
There is no equivalent SDL_GL_UnloadLibrary() to match SDL_GL_LoadLibrary().

Even though most apps would want to keep the GL loaded until process termination, there are reasonable scenarios with plugins, etc, that wouldn't.

Also, we're leaking handles and memory if we want a 100% valgrind-clean application.

Also, applications need logic, including a global variable, to know if they've already called SDL_GL_LoadLibrary() in case of reinitialization (such as when changing a game's resolution), since the second call to SDL_GL_LoadLibrary() will fail on some platforms, reporting that the library is already loaded (which, at the minimum with the current semantics, should be a no-op success if the same library is loaded).

Also, applications cannot switch GL libraries on the fly, between, say, a reference or debug implementation and the hardware-accelerated version, since they can't unload the previous library.

Obviously, SDL_GL_UnloadLibrary() should fail if SDL still uses the library internally. A requirement of having no remaining OpenGL contexts is reasonable.

--ryan.
Comment 1 Sam Lantinga 2009-02-16 20:39:20 UTC
Yeah, I went ahead and implemented this in revision 4419