summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-05-11 17:41:54 +0200
committerwm4 <wm4@nowhere>2017-05-11 17:47:33 +0200
commit2b616c0682a894152b06ef7249b32ef17037b3e5 (patch)
treed2714deb7052e11b32437d66c348fa2b2ac6562e /video/out/opengl/common.c
parentf2961425e770defe7cedc14ee2d4c9d4a53ab203 (diff)
downloadmpv-2b616c0682a894152b06ef7249b32ef17037b3e5.tar.bz2
mpv-2b616c0682a894152b06ef7249b32ef17037b3e5.tar.xz
vo_opengl: drop TLS usage
TLS is a headache. We should avoid it if we can. The involved mechanism is unfortunately entangled with the unfortunate libmpv API for returning pointers to host API objects. This has to be kept until we change the API somehow. Practically untested out of pure laziness. I'm sure I'll get a bunch of reports if it's broken.
Diffstat (limited to 'video/out/opengl/common.c')
-rw-r--r--video/out/opengl/common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 271214954a..fc0ec547db 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -610,3 +610,13 @@ void mpgl_load_functions(GL *gl, void *(*getProcAddress)(const GLubyte *),
{
mpgl_load_functions2(gl, get_procaddr_wrapper, getProcAddress, ext2, log);
}
+
+void *mpgl_get_native_display(struct GL *gl, const char *name)
+{
+ void *res = NULL;
+ if (gl->get_native_display)
+ res = gl->get_native_display(gl->get_native_display_ctx, name);
+ if (!res && gl->MPGetNativeDisplay)
+ res = gl->MPGetNativeDisplay(name);
+ return res;
+}