| Summary: | SDL_HapticIndex returns 0 for all devices on Windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | elboato |
| Component: | *don't know* | Assignee: | Edgar Simo <bobbens> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Windows (All) | ||
| Attachments: |
Untested patch to fix haptic index being 0 always when opening from joystick in windows.
Untested patch to fix haptic index being 0 always when opening from joystick in mac os x. |
||
|
Description
elboato
2010-02-12 04:44:48 UTC
Hey Edgar, do you have time to take a quick look at this? Linux uses fname, which is the name of the device path like for example /dev/input/event3 so it shouldn't have the issue. However I can confirm that it looks like haptic->index never gets properly set on windows. Have to look at mac os x also. I'll see if I can fix it real quick now. Created attachment 580 [details]
Untested patch to fix haptic index being 0 always when opening from joystick in windows.
Untested, should fix the issue.
Created attachment 581 [details]
Untested patch to fix haptic index being 0 always when opening from joystick in mac os x.
Also untested, should fix the fact the same issue exists in mac os x.
Sorry I can't fully test. I only have systems with linux at the moment and only a single haptic device. Anyway from my checking it seems like the issue is that both windows and mac os x (not linux however) do not set the haptic->index only when creating a SDL_Haptic* from a SDL_Joystick*. However creating an SDL_Haptic* by index should work. SDL_HapticIndex uses haptic->index so therefore they always return 0 on windows/darwin when created from a joystick. Both attached patches should fix it however as mentioned before I can't test them although it's seems straight forward enough to work. Thanks Edgar, your patch is in: http://hg.libsdl.org/SDL/rev/5b330ef7b8dd elboato, can you try the latest SDL snapshot and see if this fixes your issue? http://www.libsdl.org/tmp/SDL-1.3.zip Thanks! (In reply to comment #6) > elboato, can you try the latest SDL snapshot and see if this fixes your issue? > http://www.libsdl.org/tmp/SDL-1.3.zip Hi folks! Thanks a lot for your work! Unfortunately I cannot test this, because I have only one haptic device left. (I had to give back the others to the university....) Sorry! Best regards, elboato Okay, I'll mark this closed. Please reopen it if you find any issues with it. Thanks! |