src/video/ataricommon/SDL_atarigl.c
changeset 1238 1901fea5edac
parent 1005 2ab1cb02a44e
child 1239 cbdb2c156aca
     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);