Windows haptics fix

Hello,
I have been unable to get haptics to work in SDL 2.0 on Windows 7. The
call to IDirectInputDevice8_CreateEffect in SDL_SYS_HapticNewEffect in
SDL_syshaptic.c is returning E_INVALIDARG. The rgdwAxes member of the
DIEFFECT was the problem. I think this is because the DIEFF_OBJECTOFFSETS
flag is set, so the rgdwAxes should be offsets instead of object ids. I’ve
attached a patch that works for me.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_2.0_haptics.patch
Type: application/octet-stream
Size: 734 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131003/f9953b48/attachment.obj

Nice catch - are the axes guaranteed to map to those DIJOFS_[XYZ] axes? Should we be looking at the guid in DI_DeviceObjectCallback to see which axis it is, or something along those lines?

Hello,
I have been unable to get haptics to work in SDL 2.0 on Windows 7. The call to IDirectInputDevice8_CreateEffect in SDL_SYS_HapticNewEffect in SDL_syshaptic.c is returning E_INVALIDARG. The rgdwAxes member of the DIEFFECT was the problem. I think this is because the DIEFF_OBJECTOFFSETS flag is set, so the rgdwAxes should be offsets instead of object ids. I’ve attached a patch that works for me.

Jeff

I recommend attaching this patch to a bugzilla entry, so that it won’t
be lost in the mailing list.

https://bugzilla.libsdl.org/

VittorioOn Thu, Oct 3, 2013 at 9:18 PM, Jeff Baker wrote:

Hello,
I have been unable to get haptics to work in SDL 2.0 on Windows 7. The
call to IDirectInputDevice8_CreateEffect in SDL_SYS_HapticNewEffect in
SDL_syshaptic.c is returning E_INVALIDARG. The rgdwAxes member of the
DIEFFECT was the problem. I think this is because the DIEFF_OBJECTOFFSETS
flag is set, so the rgdwAxes should be offsets instead of object ids. I’ve
attached a patch that works for me.

Jeff


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org