src/haptic/windows/SDL_syshaptic.c
changeset 5539 b305e3c2d2e7
parent 5535 96594ac5fd1a
child 5591 17beb16fa838
equal deleted inserted replaced
5538:b395a72329c3 5539:b305e3c2d2e7
   547 int
   547 int
   548 SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
   548 SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
   549 {
   549 {
   550     HRESULT ret;
   550     HRESULT ret;
   551     DIDEVICEINSTANCE hap_instance, joy_instance;
   551     DIDEVICEINSTANCE hap_instance, joy_instance;
       
   552     hap_instance.dwSize = sizeof(DIDEVICEINSTANCE);
       
   553     joy_instance.dwSize = sizeof(DIDEVICEINSTANCE);
   552 
   554 
   553     /* Get the device instances. */
   555     /* Get the device instances. */
   554     ret = IDirectInputDevice2_GetDeviceInfo(haptic->hwdata->device,
   556     ret = IDirectInputDevice2_GetDeviceInfo(haptic->hwdata->device,
   555                                             &hap_instance);
   557                                             &hap_instance);
   556     if (FAILED(ret)) {
   558     if (FAILED(ret)) {
   576 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
   578 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
   577 {
   579 {
   578     int i, ret;
   580     int i, ret;
   579     HRESULT idret;
   581     HRESULT idret;
   580     DIDEVICEINSTANCE joy_instance;
   582     DIDEVICEINSTANCE joy_instance;
       
   583     joy_instance.dwSize = sizeof(DIDEVICEINSTANCE);
   581 
   584 
   582     /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
   585     /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
   583     for (i=0; i<SDL_numhaptics; i++) {
   586     for (i=0; i<SDL_numhaptics; i++) {
   584         idret = IDirectInputDevice2_GetDeviceInfo(joystick->hwdata->InputDevice,
   587         idret = IDirectInputDevice2_GetDeviceInfo(joystick->hwdata->InputDevice,
   585               &joy_instance);
   588               &joy_instance);