Seems like you have to get capabilities after setting data format. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Mon, 04 Aug 2008 17:13:16 +0000
branchgsoc2008_force_feedback
changeset 2590 a4410ff43f41
parent 2589 1154ad945d94
child 2591 07a19c1cc0a7
Seems like you have to get capabilities after setting data format.
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 );