Implement Rumble on SDL2 based gamepads#3
Implement Rumble on SDL2 based gamepads#3heraldofgargos wants to merge 1 commit intoAdamsLair:duality/masterfrom
Conversation
- Add SetVibration method to IJoystickDriver2 Interface - Implement SetVibration in Sdl2JoystickDriver.cs - Add method stubs for other sub classes that derive from IJoystickDriver2
|
Hey there. I noticed a small issue when there are two or more controllers connected at the same time. Also for some strange reason the trigger values default to 0.5 when starting an app. But they seem to return to their correct value after an axis change event is received. It's most likely an issue with the SDL2 implementation of OpenTK. I'll have a closer look later. Marking this as WIP for now. |
This is a known issue in the SDL2 backend and probably unrelated to your addition - my suggestion would be to ignore this here and potentially submit a second PR later on, if you look into this.
Got it - let me know when you're out of WiP state and ready for review 👍 |
Hey there 👋
This PR adds controller vibration support for XInput, DualShock and Nintendo Switch Pro controllers when using the SDL2 backend. It adds
SetVibrationto theIJoystickDriver2Interface which is implemented inSdl2JoystickDriver. Method stubs for other classes that derive fromIJoystickDriver2are also added but they just return false for now.SDL version 2.0.9 or higher is required for it to work!