The #define was asking to use dlopen(), but the code wasn't doing it.
Also added error message in case the library open failed in that case.
1.1 --- a/src/video/x11/SDL_x11opengl.c Sat Jan 07 21:01:33 2012 -0800
1.2 +++ b/src/video/x11/SDL_x11opengl.c Sat Jan 07 21:02:39 2012 -0800
1.3 @@ -82,8 +82,8 @@
1.4 *attrib_list);
1.5 #endif
1.6
1.7 -#define OPENGL_REQUIRS_DLOPEN
1.8 -#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
1.9 +#define OPENGL_REQUIRES_DLOPEN
1.10 +#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
1.11 #include <dlfcn.h>
1.12 #define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
1.13 #define GL_LoadFunction dlsym
1.14 @@ -109,8 +109,11 @@
1.15 if (path == NULL) {
1.16 path = DEFAULT_OPENGL;
1.17 }
1.18 - _this->gl_config.dll_handle = SDL_LoadObject(path);
1.19 + _this->gl_config.dll_handle = GL_LoadObject(path);
1.20 if (!_this->gl_config.dll_handle) {
1.21 +#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
1.22 + SDL_SetError("Failed loading %s: %s", path, dlerror());
1.23 +#endif
1.24 return -1;
1.25 }
1.26 SDL_strlcpy(_this->gl_config.driver_path, path,