Try to promote libGL.so to global scope if we can't resolve it directly

This commit is contained in:
Thorvald Natvig 2009-12-01 12:45:41 +01:00
parent 14ff24fd41
commit ff4057b6a1

View File

@ -107,6 +107,16 @@ FDEF(glXGetProcAddress);
static void resolveOpenGL() {
RESOLVE(glXSwapBuffers);
if (! oglXSwapBuffers) {
void *lib = dlopen("libGL.so.1", RTLD_GLOBAL | RTLD_NOLOAD);
if (! lib)
return;
RESOLVE(glXSwapBuffers);
if (! oglXSwapBuffers)
dlclose(lib);
}
RESOLVE(glXGetProcAddressARB);
RESOLVE(glXGetProcAddress);
}