Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Seems like you have to get capabilities after setting data format.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 4, 2008
1 parent 2245ba6 commit 4bb9877
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/haptic/win32/SDL_syshaptic.c
Expand Up @@ -230,6 +230,7 @@ DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
* - Release DirectInputDevice interface.
* - Set cooperative level.
* - Set data format.
* - Get capabilities.
* - Acquire exclusiveness.
* - Reset actuators.
* - Get supported featuers.
Expand Down Expand Up @@ -286,6 +287,14 @@ SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance)
goto query_err;
}

/* Get capabilities. */
ret = IDirectInputDevice2_GetCapabilities( haptic->hwdata->device,
&haptic->hwdata->capabilities );
if (FAILED(ret)) {
DI_SetError("Getting device capabilities",ret);
goto acquire_err;
}

/* Acquire the device. */
ret = IDirectInputDevice2_Acquire(haptic->hwdata->device);
if (FAILED(ret)) {
Expand All @@ -310,16 +319,6 @@ SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance)
goto acquire_err;
}


/* Get capabilities. */
ret = IDirectInputDevice2_GetCapabilities( haptic->hwdata->device,
&haptic->hwdata->capabilities );
if (FAILED(ret)) {
DI_SetError("Getting device capabilities",ret);
goto acquire_err;
}


/* Get supported effects. */
ret = IDirectInputDevice2_EnumEffects( haptic->hwdata->device,
DI_EffectCallback, haptic, DIEFT_ALL );
Expand Down

0 comments on commit 4bb9877

Please sign in to comment.