From a5e0fed52de934b9be053af34ce4685c63203d7c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 22 Nov 2005 09:05:15 +0000 Subject: [PATCH] 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 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11gl.c b/src/video/x11/SDL_x11gl.c index efb1fd36e..2627fae07 100644 --- a/src/video/x11/SDL_x11gl.c +++ b/src/video/x11/SDL_x11gl.c @@ -418,16 +418,23 @@ void X11_GL_UnloadLibrary(_THIS) #ifdef HAVE_OPENGL +/* If this is wrong, please put some #ifdefs for your platform! */ +#define DEFAULT_GL_DRIVER_PATH "libGL.so.1" + /* Passing a NULL path means load pointers from the application */ int X11_GL_LoadLibrary(_THIS, const char* path) { void* handle; int dlopen_flags; - if ( gl_active ) { - SDL_SetError("OpenGL context already created"); - return -1; - } + if ( gl_active ) { + SDL_SetError("OpenGL context already created"); + return -1; + } + + if ( path == NULL ) { + path = DEFAULT_GL_DRIVER_PATH; + } #ifdef RTLD_GLOBAL dlopen_flags = RTLD_LAZY | RTLD_GLOBAL;