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? */