src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2645 269ba4f28d0e
parent 2631 a0845d7f4398
child 2646 9408be170bff
--- a/src/haptic/win32/SDL_syshaptic.c	Tue Aug 12 20:49:31 2008 +0000
+++ b/src/haptic/win32/SDL_syshaptic.c	Sun Aug 24 17:17:45 2008 +0000
@@ -466,7 +466,7 @@
    }
 
    /* Status is always supported. */
-   haptic->supported |= SDL_HAPTIC_STATUS;
+   haptic->supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE;
 
    /* Check maximum effects. */
    haptic->neffects = 128; /* This is not actually supported as thus under windows,
@@ -1301,7 +1301,46 @@
    }
   
    return 0;
+}
 
+
+/*
+ * Pauses the device.
+ */
+int
+SDL_SYS_HapticPause(SDL_Haptic * haptic)
+{
+   HRESULT ret;
+
+   /* Pause the device. */
+   ret = IDirectInputDevice2_SendForceFeedbackCommand( haptic->hwdata->device,
+                                                       DISFFC_PAUSE );
+   if (FAILED(ret)) {
+      DI_SetError("Pausing the device",ret);
+      return -1;
+   }
+   
+   return 0;
+}
+
+
+/*
+ * Pauses the device.
+ */
+int
+SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
+{
+   HRESULT ret;
+
+   /* Unpause the device. */
+   ret = IDirectInputDevice2_SendForceFeedbackCommand( haptic->hwdata->device,
+                                                       DISFFC_CONTINUE );
+   if (FAILED(ret)) {
+      DI_SetError("Pausing the device",ret);
+      return -1;
+   }
+   
+   return 0;
 }