From 5a60055aa95af93f416d0142fa85c071629a0cdf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 7 Jan 2016 01:18:51 +0100 Subject: [PATCH] Make curD3D a static variable --- gfx/common/win32_common.cpp | 2 +- gfx/drivers_context/d3d_ctx.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 35a9f44b7b..fd792e3b1f 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -59,7 +59,7 @@ static bool g_quit; static HWND g_hwnd; extern void *dinput_wgl; -extern void *curD3D; +static void *curD3D = NULL; extern void *dinput; /* Power Request APIs */ diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index d76dab7cc2..b8ae7671bf 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -45,14 +45,13 @@ static bool widescreen_mode = false; #endif -void *curD3D = NULL; void *dinput; static bool gfx_ctx_d3d_set_resize(void *data, unsigned new_width, unsigned new_height) { - d3d_video_t *d3d = (d3d_video_t*)curD3D; + d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(false); - if (!d3d->dev) + if (!d3d || !d3d->dev) return false; /* No changes? */