| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | |
| | | #if SDL_JOYSTICK_XINPUT |
| | | SDL_bool bOpenedXInputDevices[XUSER_MAX_COUNT]; |
| | | SDL_zero(bOpenedXInputDevices); |
| | | SDL_zeroa(bOpenedXInputDevices); |
| | | #endif |
| | | |
| | | if (SDL_CreateDeviceNotification(¬ification_data) < 0) { |
| | |
| | | return device->bXInputDevice ? (int)device->XInputUserId : -1; |
| | | } |
| | | |
| | | static void |
| | | WINDOWS_JoystickSetDevicePlayerIndex(int device_index, int player_index) |
| | | { |
| | | } |
| | | |
| | | /* return the stable device guid for this device index */ |
| | | static SDL_JoystickGUID |
| | | WINDOWS_JoystickGetDeviceGUID(int device_index) |
| | |
| | | } |
| | | |
| | | static int |
| | | WINDOWS_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) |
| | | WINDOWS_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) |
| | | { |
| | | if (joystick->hwdata->bXInputDevice) { |
| | | return SDL_XINPUT_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms); |
| | | return SDL_XINPUT_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble); |
| | | } else { |
| | | return SDL_DINPUT_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms); |
| | | return SDL_DINPUT_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble); |
| | | } |
| | | } |
| | | |
| | |
| | | WINDOWS_JoystickDetect, |
| | | WINDOWS_JoystickGetDeviceName, |
| | | WINDOWS_JoystickGetDevicePlayerIndex, |
| | | WINDOWS_JoystickSetDevicePlayerIndex, |
| | | WINDOWS_JoystickGetDeviceGUID, |
| | | WINDOWS_JoystickGetDeviceInstanceID, |
| | | WINDOWS_JoystickOpen, |