comparison src/video/ataricommon/SDL_atarigl.c @ 1238:1901fea5edac

Load default OpenGL library if needed at driver initialization
author Patrice Mandin <patmandin@gmail.com>
date Sun, 08 Jan 2006 10:22:27 +0000
parents 2ab1cb02a44e
children cbdb2c156aca
comparison
equal deleted inserted replaced
1237:a8068adf156b 1238:1901fea5edac
132 if (gl_active) { 132 if (gl_active) {
133 SDL_SetError("OpenGL context already created"); 133 SDL_SetError("OpenGL context already created");
134 return -1; 134 return -1;
135 } 135 }
136 136
137 /* Unload previous driver */ 137 /* Driver already loaded ? */
138 SDL_AtariGL_UnloadLibrary(this); 138 if (this->gl_config.driver_loaded) {
139 /* Default path ? don't change anything */
140 if (path==NULL) {
141 return 0;
142 }
143 /* Unload previous driver */
144 SDL_AtariGL_UnloadLibrary(this);
145 }
139 146
140 /* Load library given by path */ 147 /* Load library given by path */
141 handle = SDL_LoadObject(path); 148 handle = NULL
149 if (path != NULL) {
150 handle = SDL_LoadObject(path);
151 }
142 if (handle == NULL) { 152 if (handle == NULL) {
143 /* Try to load another one */ 153 /* Try to load another one */
144 path = getenv("SDL_VIDEO_GL_DRIVER"); 154 path = getenv("SDL_VIDEO_GL_DRIVER");
145 if ( path != NULL ) { 155 if ( path != NULL ) {
146 handle = SDL_LoadObject(path); 156 handle = SDL_LoadObject(path);
396 { 406 {
397 #if defined(HAVE_OPENGL) 407 #if defined(HAVE_OPENGL)
398 if (this->gl_config.dll_handle) { 408 if (this->gl_config.dll_handle) {
399 SDL_UnloadObject(this->gl_config.dll_handle); 409 SDL_UnloadObject(this->gl_config.dll_handle);
400 this->gl_config.dll_handle = NULL; 410 this->gl_config.dll_handle = NULL;
411 this->gl_config.driver_loaded = 0;
401 412
402 /* Restore pointers to static library */ 413 /* Restore pointers to static library */
403 SDL_AtariGL_InitPointers(this); 414 SDL_AtariGL_InitPointers(this);
404 } 415 }
405 #endif 416 #endif