diff options
author | wm4 <wm4@nowhere> | 2014-08-05 19:40:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-05 20:02:23 +0200 |
commit | 210c83ab31dd69c7a47c4b89d3a5fce78d4bedf2 (patch) | |
tree | e869f6270f502dd135fb3899895efae1dee21be0 /video/out/w32_common.c | |
parent | afcbee8305e1d5c99012a6b9880b43b27b2d411a (diff) | |
download | mpv-210c83ab31dd69c7a47c4b89d3a5fce78d4bedf2.tar.bz2 mpv-210c83ab31dd69c7a47c4b89d3a5fce78d4bedf2.tar.xz |
win32: create OpenGL context on the GUI thread
This fixes the fullscreen issues on Intel for me. I'm baffled by it and
don't understand why this suddenly works. Intel drivers being shit?
Windows being shit? HWND or HDC being only 97% thread-safe instead of
98%? Me missing something subtle that is not documented anywhere?
Who knows.
Now instead of creating the HDC and OpenGL context on the renderer
thread, they're created on the GUI thread. The renderer thread will
then only call wglMakeCurrent, SwapBuffers, and OpenGL standard
functions.
Probably fixes github issue #968.
Diffstat (limited to 'video/out/w32_common.c')
-rw-r--r-- | video/out/w32_common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 33b6cdfa63..bc2a700975 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1202,3 +1202,9 @@ HWND vo_w32_hwnd(struct vo *vo) struct vo_w32_state *w32 = vo->w32; return w32->window; // immutable, so no synchronization needed } + +void vo_w32_run_on_thread(struct vo *vo, void (*cb)(void *ctx), void *ctx) +{ + struct vo_w32_state *w32 = vo->w32; + mp_dispatch_run(w32->dispatch, cb, ctx); +} |