diff src/video/x11/SDL_x11gl.c @ 1182:e8e8dcb68e7a

X11 driver now chooses "libGL.so.1" as a default when a NULL is passed to SDL_GL_LoadLibrary().
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 22 Nov 2005 09:05:15 +0000
parents 045f186426e1
children 2bd4cec0de63
line wrap: on
line diff
--- a/src/video/x11/SDL_x11gl.c	Tue Nov 22 08:21:39 2005 +0000
+++ b/src/video/x11/SDL_x11gl.c	Tue Nov 22 09:05:15 2005 +0000
@@ -418,16 +418,23 @@
 
 #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;