changeset 2587:b4b3beaea5b5 gsoc2008_force_feedback

Need to get cooperative level before acquiring.
author Edgar Simo <bobbens@gmail.com>
date Mon, 04 Aug 2008 17:03:20 +0000
parents d84c99f5401e
children 57bd3e462138
files src/haptic/win32/SDL_syshaptic.c
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/haptic/win32/SDL_syshaptic.c	Mon Aug 04 15:58:01 2008 +0000
+++ b/src/haptic/win32/SDL_syshaptic.c	Mon Aug 04 17:03:20 2008 +0000
@@ -228,6 +228,7 @@
  *       - Open temporary DirectInputDevice interface.
  *       - Create DirectInputDevice2 interface.
  *       - Release DirectInputDevice interface.
+ *       - Set cooperative level.
  *       - Acquire exclusiveness.
  *       - Reset actuators.
  *       - Get supported featuers.
@@ -267,13 +268,6 @@
       goto creat_err;
    }
 
-   /* Acquire the device. */
-   ret = IDirectInputDevice2_Acquire(haptic->hwdata->device);
-   if (FAILED(ret)) {
-      DI_SetError("Acquiring DirectInput device",ret);
-      goto query_err;
-   }
-
    /* Grab it exclusively to use force feedback stuff. */
    ret =IDirectInputDevice2_SetCooperativeLevel( haptic->hwdata->device,
                                                  SDL_HelperWindow,
@@ -283,6 +277,13 @@
       goto acquire_err;
    }
 
+   /* Acquire the device. */
+   ret = IDirectInputDevice2_Acquire(haptic->hwdata->device);
+   if (FAILED(ret)) {
+      DI_SetError("Acquiring DirectInput device",ret);
+      goto query_err;
+   }
+
    /* Reset all actuators - just in case. */
    ret = IDirectInputDevice2_SendForceFeedbackCommand( haptic->hwdata->device,
                                                        DISFFC_RESET );