summaryrefslogtreecommitdiffstats
path: root/video/out/gl_w32.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-26 20:27:03 +0200
committerwm4 <wm4@nowhere>2014-07-26 20:27:03 +0200
commitb3169390f5b63fb61fb244f603e1ecc26f9e85f9 (patch)
treedbc0e03a52b2856c6519813ecaf012534e45c4c9 /video/out/gl_w32.c
parent7077526ffbb95368f1a7cf05e9b3230e9488eb7e (diff)
downloadmpv-b3169390f5b63fb61fb244f603e1ecc26f9e85f9.tar.bz2
mpv-b3169390f5b63fb61fb244f603e1ecc26f9e85f9.tar.xz
win32: make private struct private, refactor
Preparation for moving win32 windowing to a separate thread. The codesize is reduced a bit, because some small functions are inlined, which reduces noise. The main change is that now most functions use the private struct directly, instead of accessing it indirectly through vo->w32. Accesses to vo are minimalized. The final goal is adding some sort of new windowing backend API. It would be cleaner to use that as context pointer for all functions (like struct vo was previously used), but since this is work in progress, we just go with this commit.
Diffstat (limited to 'video/out/gl_w32.c')
-rw-r--r--video/out/gl_w32.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/gl_w32.c b/video/out/gl_w32.c
index 852cea7c98..4433875cbf 100644
--- a/video/out/gl_w32.c
+++ b/video/out/gl_w32.c
@@ -45,7 +45,7 @@ static bool create_context_w32_old(struct MPGLContext *ctx)
if (*context)
return true;
- HWND win = ctx->vo->w32->window;
+ HWND win = vo_w32_hwnd(ctx->vo);
HDC windc = GetDC(win);
bool res = false;
@@ -79,7 +79,7 @@ static bool create_context_w32_gl3(struct MPGLContext *ctx)
if (*context) // reuse existing context
return true; // not reusing it breaks gl3!
- HWND win = ctx->vo->w32->window;
+ HWND win = vo_w32_hwnd(ctx->vo);
HDC windc = GetDC(win);
HGLRC new_context = 0;
@@ -190,9 +190,9 @@ static void releaseGlContext_w32(MPGLContext *ctx)
static void swapGlBuffers_w32(MPGLContext *ctx)
{
- HDC vo_hdc = GetDC(ctx->vo->w32->window);
+ HDC vo_hdc = GetDC(vo_w32_hwnd(ctx->vo));
SwapBuffers(vo_hdc);
- ReleaseDC(ctx->vo->w32->window, vo_hdc);
+ ReleaseDC(vo_w32_hwnd(ctx->vo), vo_hdc);
}
void mpgl_set_backend_w32(MPGLContext *ctx)