I didn’t check this for a while, thus my posting now:
the march 14 cvs sdl 1.1 snapshot should catch the case where the
application isn’t linked with GL’ Since this was the problem I was
mostly experiencing with the xmms plugin I experimented with, I gave it a
try. To my surprise, sdl still couldn’t find the glx symbols. I took a
look at the code and found this:
handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
/* Catch the case where the application isn't linked with GL */
if ( (handle == NULL) && (path == NULL) ) {
path = getenv("SDL_VIDEO_GL_DRIVER"); if ( path == NULL ) {
path = DEFAULT_OPENGL;
}
handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
}
if ( handle == NULL ) {
SDL_SetError("Could not load OpenGL library"); return -1;
}
This piece of code doesn’t do what it was meant to do: handle will never
be NULL. In this context, the call to dlopen will equal
handle = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);
which will return a handle to the main program. This doesn’t check for glx
at all and can thus not catch the ‘plugin situation’. The if clause
should read:
if ( (dlsym(handle, "glXChooseVisual") == NULL) && (path == NULL) ) {
or similar, in which case it will do what it is supposed to do.