diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index a3cd769801..64d88a4d3c 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -923,9 +923,7 @@ static LRESULT CALLBACK wnd_proc_common( return 0; } -/* XP and higher */ -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) -static LRESULT CALLBACK wnd_proc_common_raw_internal(HWND hwnd, +static LRESULT CALLBACK wnd_proc_common_internal(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { LRESULT ret; @@ -1014,7 +1012,6 @@ static LRESULT CALLBACK wnd_proc_common_raw_internal(HWND hwnd, return DefWindowProc(hwnd, message, wparam, lparam); } -#endif #ifdef HAVE_DINPUT static LRESULT CALLBACK wnd_proc_common_dinput_internal(HWND hwnd, @@ -1116,8 +1113,7 @@ static LRESULT CALLBACK wnd_proc_common_dinput_internal(HWND hwnd, #if defined(HAVE_D3D) || defined (HAVE_D3D10) || defined (HAVE_D3D11) || defined (HAVE_D3D12) -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) -LRESULT CALLBACK wnd_proc_d3d_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_d3d_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { win32_common_state_t *g_win32 = (win32_common_state_t*)&win32_st; @@ -1131,9 +1127,8 @@ LRESULT CALLBACK wnd_proc_d3d_raw(HWND hwnd, UINT message, return 0; } - return wnd_proc_common_raw_internal(hwnd, message, wparam, lparam); + return wnd_proc_common_internal(hwnd, message, wparam, lparam); } -#endif #ifdef HAVE_DINPUT LRESULT CALLBACK wnd_proc_d3d_dinput(HWND hwnd, UINT message, @@ -1176,8 +1171,7 @@ LRESULT CALLBACK wnd_proc_wgl_dinput(HWND hwnd, UINT message, } #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) -LRESULT CALLBACK wnd_proc_wgl_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_wgl_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { LRESULT ret; @@ -1191,10 +1185,9 @@ LRESULT CALLBACK wnd_proc_wgl_raw(HWND hwnd, UINT message, return 0; } - return wnd_proc_common_raw_internal(hwnd, message, wparam, lparam); + return wnd_proc_common_internal(hwnd, message, wparam, lparam); } #endif -#endif #ifdef HAVE_VULKAN #ifdef HAVE_DINPUT @@ -1215,8 +1208,7 @@ LRESULT CALLBACK wnd_proc_vk_dinput(HWND hwnd, UINT message, } #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) -LRESULT CALLBACK wnd_proc_vk_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_vk_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { win32_common_state_t *g_win32 = (win32_common_state_t*)&win32_st; @@ -1229,10 +1221,9 @@ LRESULT CALLBACK wnd_proc_vk_raw(HWND hwnd, UINT message, return 0; } - return wnd_proc_common_raw_internal(hwnd, message, wparam, lparam); + return wnd_proc_common_internal(hwnd, message, wparam, lparam); } #endif -#endif #ifdef HAVE_GDI #ifdef HAVE_DINPUT @@ -1285,8 +1276,7 @@ LRESULT CALLBACK wnd_proc_gdi_dinput(HWND hwnd, UINT message, } #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) -LRESULT CALLBACK wnd_proc_gdi_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_gdi_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { LRESULT ret; @@ -1331,10 +1321,9 @@ LRESULT CALLBACK wnd_proc_gdi_raw(HWND hwnd, UINT message, #endif } - return wnd_proc_common_raw_internal(hwnd, message, wparam, lparam); + return wnd_proc_common_internal(hwnd, message, wparam, lparam); } #endif -#endif bool win32_window_create(void *data, unsigned style, RECT *mon_rect, unsigned width, diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 1558b7ab79..bfe424298b 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -125,27 +125,27 @@ float win32_get_refresh_rate(void *data); #if defined(HAVE_D3D8) || defined(HAVE_D3D9) || defined (HAVE_D3D10) || defined (HAVE_D3D11) || defined (HAVE_D3D12) LRESULT CALLBACK wnd_proc_d3d_dinput(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); -LRESULT CALLBACK wnd_proc_d3d_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_d3d_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); #endif #if defined(HAVE_OPENGL) || defined(HAVE_OPENGL1) || defined(HAVE_OPENGL_CORE) LRESULT CALLBACK wnd_proc_wgl_dinput(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); -LRESULT CALLBACK wnd_proc_wgl_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_wgl_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); #endif #if defined(HAVE_VULKAN) LRESULT CALLBACK wnd_proc_vk_dinput(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); -LRESULT CALLBACK wnd_proc_vk_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_vk_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); #endif LRESULT CALLBACK wnd_proc_gdi_dinput(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); -LRESULT CALLBACK wnd_proc_gdi_raw(HWND hwnd, UINT message, +LRESULT CALLBACK wnd_proc_gdi_common(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); #ifdef _XBOX diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index ce19613978..135cab47f0 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -621,14 +621,11 @@ static void *d3d10_gfx_init(const video_info_t* video, #endif #ifdef HAVE_MONITOR win32_monitor_init(); + wndclass.lpfnWndProc = wnd_proc_d3d_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) wndclass.lpfnWndProc = wnd_proc_d3d_dinput; #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - wndclass.lpfnWndProc = wnd_proc_d3d_raw; -#endif #ifdef HAVE_WINDOW win32_window_init(&wndclass, true, NULL); #endif diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 473e7ced02..c04e032085 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -656,14 +656,11 @@ static void *d3d11_gfx_init(const video_info_t* video, #endif #ifdef HAVE_MONITOR win32_monitor_init(); + wndclass.lpfnWndProc = wnd_proc_d3d_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) wndclass.lpfnWndProc = wnd_proc_d3d_dinput; #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - wndclass.lpfnWndProc = wnd_proc_d3d_raw; -#endif #ifdef HAVE_WINDOW win32_window_init(&wndclass, true, NULL); #endif diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index a6d47e8526..bacb9b2e5f 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -913,14 +913,11 @@ static void *d3d12_gfx_init(const video_info_t* video, #endif #ifdef HAVE_MONITOR win32_monitor_init(); + wndclass.lpfnWndProc = wnd_proc_d3d_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) wndclass.lpfnWndProc = wnd_proc_d3d_dinput; #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - wndclass.lpfnWndProc = wnd_proc_d3d_raw; -#endif #ifdef HAVE_WINDOW win32_window_init(&wndclass, true, NULL); #endif diff --git a/gfx/drivers/d3d8.c b/gfx/drivers/d3d8.c index 592912417a..ea485e64cc 100644 --- a/gfx/drivers/d3d8.c +++ b/gfx/drivers/d3d8.c @@ -1148,13 +1148,10 @@ static bool d3d8_init_internal(d3d8_video_t *d3d, #ifdef HAVE_WINDOW memset(&d3d->windowClass, 0, sizeof(d3d->windowClass)); + d3d->windowClass.lpfnWndProc = wnd_proc_d3d_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) d3d->windowClass.lpfnWndProc = wnd_proc_d3d_dinput; -#endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - d3d->windowClass.lpfnWndProc = wnd_proc_d3d_raw; #endif win32_window_init(&d3d->windowClass, true, NULL); #endif diff --git a/gfx/drivers/d3d9.c b/gfx/drivers/d3d9.c index 42c8277e4a..19f2aa71a2 100644 --- a/gfx/drivers/d3d9.c +++ b/gfx/drivers/d3d9.c @@ -1158,13 +1158,10 @@ static bool d3d9_init_internal(d3d9_video_t *d3d, #ifdef HAVE_WINDOW memset(&d3d->windowClass, 0, sizeof(d3d->windowClass)); + d3d->windowClass.lpfnWndProc = wnd_proc_d3d_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) d3d->windowClass.lpfnWndProc = wnd_proc_d3d_dinput; -#endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - d3d->windowClass.lpfnWndProc = wnd_proc_d3d_raw; #endif win32_window_init(&d3d->windowClass, true, NULL); #endif diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index 8eedbc9763..8106b2b205 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -91,15 +91,11 @@ static bool gfx_ctx_gdi_init(void) win32_window_reset(); win32_monitor_init(); + wndclass.lpfnWndProc = wnd_proc_gdi_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) wndclass.lpfnWndProc = wnd_proc_gdi_dinput; #endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - wndclass.lpfnWndProc = wnd_proc_gdi_raw; -#endif - if (!win32_window_init(&wndclass, true, NULL)) return false; return true; diff --git a/gfx/drivers_context/w_vk_ctx.c b/gfx/drivers_context/w_vk_ctx.c index 273521cca3..6dec4a1e1c 100644 --- a/gfx/drivers_context/w_vk_ctx.c +++ b/gfx/drivers_context/w_vk_ctx.c @@ -218,13 +218,10 @@ static void *gfx_ctx_w_vk_init(void *video_driver) { settings_t *settings = config_get_ptr(); + wndclass.lpfnWndProc = wnd_proc_vk_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) wndclass.lpfnWndProc = wnd_proc_vk_dinput; -#endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - wndclass.lpfnWndProc = wnd_proc_vk_raw; #endif } if (!win32_window_init(&wndclass, true, NULL)) diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 96f5badf00..930b81ab9f 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -633,13 +633,10 @@ static void *gfx_ctx_wgl_init(void *video_driver) { settings_t *settings = config_get_ptr(); + wndclass.lpfnWndProc = wnd_proc_wgl_common; #ifdef HAVE_DINPUT if (string_is_equal(settings->arrays.input_driver, "dinput")) wndclass.lpfnWndProc = wnd_proc_wgl_dinput; -#endif -#if _WIN32_WINNT >= 0x0501 && defined(HAVE_WINRAWINPUT) - if (string_is_equal(settings->arrays.input_driver, "raw")) - wndclass.lpfnWndProc = wnd_proc_wgl_raw; #endif }