Closed cgutman closed 9 months ago
Feel free to submit a PR whenever you want for this.
I've landed on removing gamepad rumble from the haptics API in favor of the much simpler SDL_RumbleGamepad()
If you have a use case where this isn't possible, please let me know and we can reopen this.
Many older SDL applications use
SDL_Haptic
instead of the newerSDL_JoystickRumble()
andSDL_GameControllerRumble()
APIs. Since most of the new joystick backends (WGI, RawInput, and HIDAPI) don't provide a correspondingSDL_Haptic
implementation, this prevents force feedback from working in older games. In some cases, SDL will use one of the newer backends like RawInput where it would have previously used an older SDL_Haptic-capable backend (XInput) which has the effect of regressing force feedback when updating to a newer version of SDL.We can use
SDL_JoystickHasRumble()
and a newSDL_SYS_Haptic
implementation to provide emulation of SDL_Haptic on rumble-capable joysticks that lack associated haptic devices. It's not completely straightforward because the haptic subsystem assumes there will only be one haptic backend. It will take some refactoring to accomplish but should be doable.