# HG changeset patch # User Edgar Simo # Date 1217869996 0 # Node ID a4410ff43f41a6b1e708464802dae93c284d736e # Parent 1154ad945d94086ca329c08f3746354831755e88 Seems like you have to get capabilities after setting data format. diff -r 1154ad945d94 -r a4410ff43f41 src/haptic/win32/SDL_syshaptic.c --- a/src/haptic/win32/SDL_syshaptic.c Mon Aug 04 17:09:45 2008 +0000 +++ b/src/haptic/win32/SDL_syshaptic.c Mon Aug 04 17:13:16 2008 +0000 @@ -230,6 +230,7 @@ * - Release DirectInputDevice interface. * - Set cooperative level. * - Set data format. + * - Get capabilities. * - Acquire exclusiveness. * - Reset actuators. * - Get supported featuers. @@ -286,6 +287,14 @@ 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)) { @@ -310,16 +319,6 @@ 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 );