diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index e0e547cf60..7068dbd721 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -75,7 +75,7 @@ const GUID GUID_DEVINTERFACE_HID = { 0x4d1e55b2, 0xf16f, 0x11Cf, { 0x88, 0xcb, 0 static HDEVNOTIFY notification_handler; #endif -#if defined(HAVE_D3D8) || defined(HAVE_D3D9) || defined (HAVE_D3D10) || defined (HAVE_D3D11) || defined (HAVE_D3D12) +#ifdef HAVE_DINPUT extern bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam); extern void *dinput_gdi; @@ -569,7 +569,6 @@ static void win32_set_droppable(ui_window_win32_t *window, bool droppable) DragAcceptFiles_func(window->hwnd, droppable); } -#if defined(HAVE_D3D8) || defined(HAVE_D3D9) || defined (HAVE_D3D10) || defined (HAVE_D3D11) || defined (HAVE_D3D12) LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { @@ -616,9 +615,11 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, win32_set_taskbar_created(true); #endif +#ifdef HAVE_DINPUT if (dinput && dinput_handle_message(dinput, message, wparam, lparam)) return 0; +#endif return DefWindowProc(hwnd, message, wparam, lparam); } #endif @@ -669,7 +670,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, win32_set_taskbar_created(true); #endif -#if defined(HAVE_D3D9) || defined(HAVE_D3D8) +#ifdef HAVE_DINPUT if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; @@ -767,7 +768,7 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message, win32_set_taskbar_created(true); #endif -#if defined(HAVE_D3D9) || defined(HAVE_D3D8) +#ifdef HAVE_DINPUT if (dinput_gdi && dinput_handle_message(dinput_gdi, message, wparam, lparam)) return 0; diff --git a/gfx/drivers_context/d3d_ctx.c b/gfx/drivers_context/d3d_ctx.c index f8ac2d6096..ee17491ecf 100644 --- a/gfx/drivers_context/d3d_ctx.c +++ b/gfx/drivers_context/d3d_ctx.c @@ -175,14 +175,20 @@ static bool gfx_ctx_d3d_bind_api(void *data, (void)data; (void)major; (void)minor; - (void)api; -#if defined(HAVE_D3D8) - return api == GFX_CTX_DIRECT3D8_API; -#else - /* As long as we don't have a D3D11 implementation, we default to this */ - return api == GFX_CTX_DIRECT3D9_API; -#endif + switch (api) + { + case GFX_CTX_DIRECT3D8_API: + if (api == GFX_CTX_DIRECT3D8_API) + return true; + break; + case GFX_CTX_DIRECT3D9_API: + if (api == GFX_CTX_DIRECT3D9_API) + return true; + break; + } + + return false; } static void *gfx_ctx_d3d_init(video_frame_info_t *video_info, void *video_driver)