path: root/waftools/fragments
diff options
authorwm4 <wm4@nowhere>2014-05-31 21:53:04 +0200
committerwm4 <wm4@nowhere>2014-05-31 21:53:04 +0200
commit8178b80748e79b2aac9cb712a82c949cb34b1e6d (patch)
treebd4b6482ad0f5d6ba0a3e3baa2ab23f512a588f0 /waftools/fragments
parent9f6e8d64de18d6bc57ee3338d6b900d669f35c0b (diff)
gl_x11: always require some GLX API functions, avoid dlsym()
The functions glXGetProcAddressARB() and glXQueryExtensionsString() were loaded using dlsym(). This could fail when compiling to libmpv, because then dlopen(NULL, ...) will look in the main program's list of libraries, and the libGL linked to libmpv is never considered. (Don't know if this somehow could be worked around.) The result is that using vo_opengl with libmpv can fail. Avoid this by not using dlsym(). glXGetProcAddressARB() was already used directly in the same file, and that never caused any problems. (Still add it to the configure test.) glXQueryExtensionsString() is documented as added in GLX 1.1 - that's ancient.
Diffstat (limited to 'waftools/fragments')
1 files changed, 3 insertions, 0 deletions
diff --git a/waftools/fragments/gl_x11.c b/waftools/fragments/gl_x11.c
index 6c617d43ee..8f6c950f47 100644
--- a/waftools/fragments/gl_x11.c
+++ b/waftools/fragments/gl_x11.c
@@ -1,9 +1,12 @@
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <GL/gl.h>
+#include <stddef.h>
int main(int argc, char *argv[]) {
glXCreateContext(NULL, NULL, NULL, True);
+ glXQueryExtensionsString(NULL, 0);
+ glXGetProcAddressARB("");
return 0;