src/haptic/windows/SDL_dinputhaptic.c
changeset 10463 ac6a748250f4
parent 10442 80d5e7642a06
child 10737 3406a0f8b041
     1.1 --- a/src/haptic/windows/SDL_dinputhaptic.c	Tue Oct 04 03:42:42 2016 -0700
     1.2 +++ b/src/haptic/windows/SDL_dinputhaptic.c	Tue Oct 04 03:50:28 2016 -0700
     1.3 @@ -331,14 +331,6 @@
     1.4              goto acquire_err;
     1.5          }
     1.6  
     1.7 -        /* Get number of axes. */
     1.8 -        ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device,
     1.9 -                                              DI_DeviceObjectCallback,
    1.10 -                                              haptic, DIDFT_AXIS);
    1.11 -        if (FAILED(ret)) {
    1.12 -            DI_SetError("Getting device axes", ret);
    1.13 -            goto acquire_err;
    1.14 -        }
    1.15  
    1.16          /* Acquire the device. */
    1.17          ret = IDirectInputDevice8_Acquire(haptic->hwdata->device);
    1.18 @@ -348,6 +340,15 @@
    1.19          }
    1.20      }
    1.21  
    1.22 +    /* Get number of axes. */
    1.23 +    ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device,
    1.24 +                                          DI_DeviceObjectCallback,
    1.25 +                                          haptic, DIDFT_AXIS);
    1.26 +    if (FAILED(ret)) {
    1.27 +        DI_SetError("Getting device axes", ret);
    1.28 +        goto acquire_err;
    1.29 +    }
    1.30 +
    1.31      /* Reset all actuators - just in case. */
    1.32      ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
    1.33                                                         DISFFC_RESET);