X11 driver now chooses "libGL.so.1" as a default when a NULL is passed to
authorRyan C. Gordon <icculus@icculus.org>
Tue, 22 Nov 2005 09:05:15 +0000
changeset 1182e8e8dcb68e7a
parent 1181 49d3efec6651
child 1183 634d85aefc8c
X11 driver now chooses "libGL.so.1" as a default when a NULL is passed to
SDL_GL_LoadLibrary().
src/video/x11/SDL_x11gl.c
     1.1 --- a/src/video/x11/SDL_x11gl.c	Tue Nov 22 08:21:39 2005 +0000
     1.2 +++ b/src/video/x11/SDL_x11gl.c	Tue Nov 22 09:05:15 2005 +0000
     1.3 @@ -418,16 +418,23 @@
     1.4  
     1.5  #ifdef HAVE_OPENGL
     1.6  
     1.7 +/* If this is wrong, please put some #ifdefs for your platform! */
     1.8 +#define DEFAULT_GL_DRIVER_PATH "libGL.so.1"
     1.9 +
    1.10  /* Passing a NULL path means load pointers from the application */
    1.11  int X11_GL_LoadLibrary(_THIS, const char* path) 
    1.12  {
    1.13  	void* handle;
    1.14  	int dlopen_flags;
    1.15  
    1.16 - 	if ( gl_active ) {
    1.17 - 		SDL_SetError("OpenGL context already created");
    1.18 - 		return -1;
    1.19 - 	}
    1.20 +	if ( gl_active ) {
    1.21 +		SDL_SetError("OpenGL context already created");
    1.22 +		return -1;
    1.23 +	}
    1.24 +
    1.25 +	if ( path == NULL ) {
    1.26 +		path = DEFAULT_GL_DRIVER_PATH;
    1.27 +	}
    1.28  
    1.29  #ifdef RTLD_GLOBAL
    1.30  	dlopen_flags = RTLD_LAZY | RTLD_GLOBAL;