| Summary: | [Post-2.0] [Patch] SDL_HapticRumble Support | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ethan Lee <flibitijibibo> |
| Component: | haptic | Assignee: | Edgar Simo <bobbens> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
SDL_HapticRumble Patch
SDL_HapticRumble Patch (r2) |
||
Created attachment 1146 [details]
SDL_HapticRumble Patch (r2)
Fix tabbing on struct SDL_HapticRumble
Hello,
I never implemented FF_RUMBLE because of the following note [1]:
Note: In most cases you should use FF_PERIODIC instead of FF_RUMBLE. All
devices that support FF_RUMBLE support FF_PERIODIC (square, triangle,
sine) and the other way around.
I guess I didn't realize either that we were out of bits, or I would have gone with int32_t.
@sam You changed the version to HG2.1. I'm not sure how you guys are handling HG these days (totally out of the loop), I'm guessing you wouldn't want it for this months release yet?
[1]: https://www.kernel.org/doc/Documentation/input/ff.txt
I changed the version to 2.1 because SDL is ABI frozen for release. This now exists in SDL 2.0.0 as SDL_HAPTIC_LEFTRIGHT. |
Created attachment 1141 [details] SDL_HapticRumble Patch In XInput, you can use XINPUT_VIBRATION to control the left and right (or high-frequency and low-frequency) motors on a controller. On Linux, we have FF_RUMBLE. This patch adds a HapticRumble struct and a new HapticEffect type, SDL_HAPTIC_RUMBLE. While the addition itself seems trivial, the problem is that we already use all 16 bits for the type, so adding SDL_HAPTIC_RUMBLE requires changing type's type, which breaks the API. For something this trivial, I don't know if it's worth making that kind of change at the last minute... maybe for the next release? You'll also notice that this only affects Windows and Linux. As far as I know, Apple's Force Feedback API does not have a feature like this, so on OSX, this will simply be unsupported for all Haptic devices.