From b3169390f5b63fb61fb244f603e1ecc26f9e85f9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 26 Jul 2014 20:27:03 +0200 Subject: 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. --- video/out/gl_w32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/out/gl_w32.c') 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) -- cgit v1.2.3