diff options
author | wm4 <wm4@nowhere> | 2015-03-25 12:29:19 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-25 12:29:19 +0100 |
commit | 85c21ae40940d6c54e36b5822e9ac1a517185b07 (patch) | |
tree | 37e662c833eb9e622514f40d46d5ffd7755df81f /video/out/gl_common.c | |
parent | cdf9abd872f1923ef5a185d06b412f342935f107 (diff) | |
download | mpv-85c21ae40940d6c54e36b5822e9ac1a517185b07.tar.bz2 mpv-85c21ae40940d6c54e36b5822e9ac1a517185b07.tar.xz |
vo_opengl: cleanup swap_control extension loading
Instead of somehow looking for the substring "_swap_control" and trying
to several arbitrary function names, do it cleanly. The old approach has
the problem that it's not very exact, and may even load a pointer to a
function which doesn't exist. (Some GL implementations like Mesa return
function pointers even the functions which don't exist, and calling them
crashes.)
I couldn't find any evidence that glXSwapInterval, wglSwapIntervalSGI,
or wglSwapInterval actually exist, so don't include them. They were
carried over from MPlayer times.
To make diagnostics easier, print a warning in verbose mode if the
function could not be loaded.
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r-- | video/out/gl_common.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 638d757eea..14d7649e8b 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -243,13 +243,19 @@ static const struct gl_functions gl_functions[] = { .provides = MPGL_CAP_TEX_RG, }, // Swap control, always an OS specific extension + // The OSX code loads this manually. { - .extension = "_swap_control", + .extension = "GLX_SGI_swap_control", .functions = (const struct gl_function[]) { - DEF_FN_NAMES(SwapInterval, "glXSwapIntervalSGI", "glXSwapInterval", - "wglSwapIntervalSGI", "wglSwapInterval", - "wglSwapIntervalEXT"), - {0} + DEF_FN_NAMES(SwapInterval, "glXSwapIntervalSGI"), + {0}, + }, + }, + { + .extension = "WGL_EXT_swap_control", + .functions = (const struct gl_function[]) { + DEF_FN_NAMES(SwapInterval, "wglSwapIntervalEXT"), + {0}, }, }, { |