From 9358b0c3f348b5ec2a5407e5d33aa57d4d34349b Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Fri, 19 May 2017 16:13:32 +0200 Subject: [PATCH] Allow raw input driver with OpenGL driver under Windows --- gfx/drivers_context/wgl_ctx.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 79555e8d59..fd218b0cfb 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -579,10 +579,22 @@ static void gfx_ctx_wgl_input_driver(void *data, const char *joypad_name, const input_driver_t **input, void **input_data) { - dinput_wgl = input_dinput.init(joypad_name); + settings_t *settings = config_get_ptr(); - *input = dinput_wgl ? &input_dinput : NULL; - *input_data = dinput_wgl; + if (memcmp(settings->arrays.input_driver, "raw", 4) == 0) + { + *input_data = input_winraw.init(joypad_name); + if (*input_data) + { + *input = &input_winraw; + dinput_wgl = NULL; + return; + } + } + + dinput_wgl = input_dinput.init(joypad_name); + *input = dinput_wgl ? &input_dinput : NULL; + *input_data = dinput_wgl; } static bool gfx_ctx_wgl_has_focus(void *data)