Mercurial > sdl-ios-xcode
changeset 2590:a4410ff43f41 gsoc2008_force_feedback
Seems like you have to get capabilities after setting data format.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Mon, 04 Aug 2008 17:13:16 +0000 |
parents | 1154ad945d94 |
children | 07a19c1cc0a7 |
files | src/haptic/win32/SDL_syshaptic.c |
diffstat | 1 files changed, 9 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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 );