|
@@ -331,14 +331,6 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device
|
|
|
goto acquire_err;
|
|
|
}
|
|
|
|
|
|
- /* Get number of axes. */
|
|
|
- ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device,
|
|
|
- DI_DeviceObjectCallback,
|
|
|
- haptic, DIDFT_AXIS);
|
|
|
- if (FAILED(ret)) {
|
|
|
- DI_SetError("Getting device axes", ret);
|
|
|
- goto acquire_err;
|
|
|
- }
|
|
|
|
|
|
/* Acquire the device. */
|
|
|
ret = IDirectInputDevice8_Acquire(haptic->hwdata->device);
|
|
@@ -348,6 +340,15 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /* Get number of axes. */
|
|
|
+ ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device,
|
|
|
+ DI_DeviceObjectCallback,
|
|
|
+ haptic, DIDFT_AXIS);
|
|
|
+ if (FAILED(ret)) {
|
|
|
+ DI_SetError("Getting device axes", ret);
|
|
|
+ goto acquire_err;
|
|
|
+ }
|
|
|
+
|
|
|
/* Reset all actuators - just in case. */
|
|
|
ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
|
|
|
DISFFC_RESET);
|