mirror of
https://github.com/yawut/SDL.git
synced 2026-06-12 19:51:40 -05:00
Load default OpenGL library if needed at driver initialization
This commit is contained in:
parent
91722486aa
commit
1406542e05
|
|
@ -134,11 +134,21 @@ int SDL_AtariGL_LoadLibrary(_THIS, const char *path)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Unload previous driver */
|
||||
SDL_AtariGL_UnloadLibrary(this);
|
||||
/* Driver already loaded ? */
|
||||
if (this->gl_config.driver_loaded) {
|
||||
/* Default path ? don't change anything */
|
||||
if (path==NULL) {
|
||||
return 0;
|
||||
}
|
||||
/* Unload previous driver */
|
||||
SDL_AtariGL_UnloadLibrary(this);
|
||||
}
|
||||
|
||||
/* Load library given by path */
|
||||
handle = SDL_LoadObject(path);
|
||||
handle = NULL
|
||||
if (path != NULL) {
|
||||
handle = SDL_LoadObject(path);
|
||||
}
|
||||
if (handle == NULL) {
|
||||
/* Try to load another one */
|
||||
path = getenv("SDL_VIDEO_GL_DRIVER");
|
||||
|
|
@ -398,6 +408,7 @@ static void SDL_AtariGL_UnloadLibrary(_THIS)
|
|||
if (this->gl_config.dll_handle) {
|
||||
SDL_UnloadObject(this->gl_config.dll_handle);
|
||||
this->gl_config.dll_handle = NULL;
|
||||
this->gl_config.driver_loaded = 0;
|
||||
|
||||
/* Restore pointers to static library */
|
||||
SDL_AtariGL_InitPointers(this);
|
||||
|
|
|
|||
|
|
@ -468,6 +468,7 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat)
|
|||
|
||||
#ifdef HAVE_OPENGL
|
||||
SDL_AtariGL_InitPointers(this);
|
||||
SDL_AtariGL_LoadLibrary(this, NULL);
|
||||
#endif
|
||||
|
||||
/* We're done! */
|
||||
|
|
|
|||
|
|
@ -464,6 +464,7 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
|
|||
|
||||
#ifdef HAVE_OPENGL
|
||||
SDL_AtariGL_InitPointers(this);
|
||||
SDL_AtariGL_LoadLibrary(this, NULL);
|
||||
#endif
|
||||
|
||||
/* We're done! */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user