From 1470f3d2da98d47fdcc425d23d7dd74a66694f41 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 7 Jan 2012 21:02:39 -0800 Subject: [PATCH] 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. --- src/video/x11/SDL_x11opengl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 63cb6c858..f3875f0c5 100755 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -82,8 +82,8 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, *attrib_list); #endif -#define OPENGL_REQUIRS_DLOPEN -#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN) +#define OPENGL_REQUIRES_DLOPEN +#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN) #include #define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL)) #define GL_LoadFunction dlsym @@ -109,8 +109,11 @@ X11_GL_LoadLibrary(_THIS, const char *path) if (path == NULL) { path = DEFAULT_OPENGL; } - _this->gl_config.dll_handle = SDL_LoadObject(path); + _this->gl_config.dll_handle = GL_LoadObject(path); if (!_this->gl_config.dll_handle) { +#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN) + SDL_SetError("Failed loading %s: %s", path, dlerror()); +#endif return -1; } SDL_strlcpy(_this->gl_config.driver_path, path,