From a838a56d45b237888810ca4c76d9345fe98f27f6 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Wed, 25 Jun 2014 22:03:05 -0400 Subject: [PATCH] WinRT build fix --- src/joystick/winrt/SDL_xinputjoystick.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/joystick/winrt/SDL_xinputjoystick.c b/src/joystick/winrt/SDL_xinputjoystick.c index 63e694c53..02ed3a134 100644 --- a/src/joystick/winrt/SDL_xinputjoystick.c +++ b/src/joystick/winrt/SDL_xinputjoystick.c @@ -524,6 +524,17 @@ SDL_bool SDL_SYS_IsXInputDeviceIndex(int device_index) return SDL_TRUE; } +SDL_bool SDL_SYS_IsXInputGamepad_DeviceIndex(int device_index) +{ + XINPUT_CAPABILITIES deviceCaps; + + if (SDL_XInput_GetDeviceCapabilities(device_index, &deviceCaps) != 0) { + return SDL_FALSE; + } + + return (deviceCaps.SubType == XINPUT_DEVSUBTYPE_GAMEPAD); +} + #endif /* SDL_JOYSTICK_XINPUT */ /* vi: set ts=4 sw=4 expandtab: */