Load default OpenGL library if needed at driver initialization
authorPatrice Mandin <patmandin@gmail.com>
Sun, 08 Jan 2006 10:22:27 +0000
changeset 12381901fea5edac
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
     1.1 --- a/src/video/ataricommon/SDL_atarigl.c	Fri Jan 06 22:24:09 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_atarigl.c	Sun Jan 08 10:22:27 2006 +0000
     1.3 @@ -134,11 +134,21 @@
     1.4  		return -1;
     1.5  	}
     1.6  
     1.7 -	/* Unload previous driver */
     1.8 -	SDL_AtariGL_UnloadLibrary(this);
     1.9 +	/* Driver already loaded ? */
    1.10 +	if (this->gl_config.driver_loaded) {
    1.11 +		/* Default path ? don't change anything */
    1.12 +		if (path==NULL) {
    1.13 +			return 0;
    1.14 +		}
    1.15 +		/* Unload previous driver */
    1.16 +		SDL_AtariGL_UnloadLibrary(this);
    1.17 +	}
    1.18  
    1.19  	/* Load library given by path */
    1.20 -	handle = SDL_LoadObject(path);
    1.21 +	handle = NULL
    1.22 +	if (path != NULL) {
    1.23 +		handle = SDL_LoadObject(path);
    1.24 +	}
    1.25  	if (handle == NULL) {
    1.26  		/* Try to load another one */
    1.27  		path = getenv("SDL_VIDEO_GL_DRIVER");
    1.28 @@ -398,6 +408,7 @@
    1.29  	if (this->gl_config.dll_handle) {
    1.30  		SDL_UnloadObject(this->gl_config.dll_handle);
    1.31  		this->gl_config.dll_handle = NULL;
    1.32 +		this->gl_config.driver_loaded = 0;
    1.33  
    1.34  		/* Restore pointers to static library */
    1.35  		SDL_AtariGL_InitPointers(this);
     2.1 --- a/src/video/gem/SDL_gemvideo.c	Fri Jan 06 22:24:09 2006 +0000
     2.2 +++ b/src/video/gem/SDL_gemvideo.c	Sun Jan 08 10:22:27 2006 +0000
     2.3 @@ -468,6 +468,7 @@
     2.4  
     2.5  #ifdef HAVE_OPENGL
     2.6  	SDL_AtariGL_InitPointers(this);
     2.7 +	SDL_AtariGL_LoadLibrary(this, NULL);
     2.8  #endif
     2.9  
    2.10  	/* We're done! */
     3.1 --- a/src/video/xbios/SDL_xbios.c	Fri Jan 06 22:24:09 2006 +0000
     3.2 +++ b/src/video/xbios/SDL_xbios.c	Sun Jan 08 10:22:27 2006 +0000
     3.3 @@ -464,6 +464,7 @@
     3.4  
     3.5  #ifdef HAVE_OPENGL
     3.6  	SDL_AtariGL_InitPointers(this);
     3.7 +	SDL_AtariGL_LoadLibrary(this, NULL);
     3.8  #endif
     3.9  
    3.10  	/* We're done! */