diff options
author | wm4 <wm4@nowhere> | 2017-05-11 17:41:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-05-11 17:47:33 +0200 |
commit | 2b616c0682a894152b06ef7249b32ef17037b3e5 (patch) | |
tree | d2714deb7052e11b32437d66c348fa2b2ac6562e /video/out/opengl/common.h | |
parent | f2961425e770defe7cedc14ee2d4c9d4a53ab203 (diff) | |
download | mpv-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.h')
-rw-r--r-- | video/out/opengl/common.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h index 3eb2a8ecf8..351624051f 100644 --- a/video/out/opengl/common.h +++ b/video/out/opengl/common.h @@ -74,6 +74,9 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n), typedef void (GLAPIENTRY *MP_GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar *,const void *); +// Return a named host API reference (e.g. "wl" -> wl_display). +void *mpgl_get_native_display(struct GL *gl, const char *name); + //function pointers loaded from the OpenGL library struct GL { int version; // MPGL_VER() mangled (e.g. 210 for 2.1) @@ -83,6 +86,11 @@ struct GL { int mpgl_caps; // Bitfield of MPGL_CAP_* constants bool debug_context; // use of e.g. GLX_CONTEXT_DEBUG_BIT_ARB + // Use mpgl_get_native_display() instead. Also, this is set to use the + // fields in MPGLContext by default (if set). + void *get_native_display_ctx; + void *(*get_native_display)(void *ctx, const char *name); + void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei); void (GLAPIENTRY *Clear)(GLbitfield); void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *); |