Load default OpenGL library if needed at driver initialization
authorPatrice Mandin <patmandin@gmail.com>
Sun, 08 Jan 2006 10:22:27 +0000
changeset 1238 1901fea5edac
parent 1237 a8068adf156b
child 1239 cbdb2c156aca
Load default OpenGL library if needed at driver initialization
src/video/ataricommon/SDL_atarigl.c
src/video/gem/SDL_gemvideo.c
src/video/xbios/SDL_xbios.c
--- a/src/video/ataricommon/SDL_atarigl.c	Fri Jan 06 22:24:09 2006 +0000
+++ b/src/video/ataricommon/SDL_atarigl.c	Sun Jan 08 10:22:27 2006 +0000
@@ -134,11 +134,21 @@
 		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 @@
 	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);
--- a/src/video/gem/SDL_gemvideo.c	Fri Jan 06 22:24:09 2006 +0000
+++ b/src/video/gem/SDL_gemvideo.c	Sun Jan 08 10:22:27 2006 +0000
@@ -468,6 +468,7 @@
 
 #ifdef HAVE_OPENGL
 	SDL_AtariGL_InitPointers(this);
+	SDL_AtariGL_LoadLibrary(this, NULL);
 #endif
 
 	/* We're done! */
--- a/src/video/xbios/SDL_xbios.c	Fri Jan 06 22:24:09 2006 +0000
+++ b/src/video/xbios/SDL_xbios.c	Sun Jan 08 10:22:27 2006 +0000
@@ -464,6 +464,7 @@
 
 #ifdef HAVE_OPENGL
 	SDL_AtariGL_InitPointers(this);
+	SDL_AtariGL_LoadLibrary(this, NULL);
 #endif
 
 	/* We're done! */