1
mirror of https://github.com/mpv-player/mpv synced 2024-10-26 07:22:17 +02:00
mpv/waftools/fragments/gl_x11.c
wm4 8178b80748 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.
2014-05-31 21:53:04 +02:00

13 lines
254 B
C

#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("");
glFinish();
return 0;
}