diff src/haptic/SDL_haptic.c @ 2485:67978eea6d10 gsoc2008_force_feedback

Added SDL_HapticStopEffect().
author Edgar Simo <bobbens@gmail.com>
date Tue, 01 Jul 2008 14:31:04 +0000
parents 666472fd4cb0
children 24dd8b8669fa
line wrap: on
line diff
--- a/src/haptic/SDL_haptic.c	Tue Jul 01 14:21:09 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Tue Jul 01 14:31:04 2008 +0000
@@ -307,6 +307,24 @@
 }
 
 /*
+ * Stops the haptic effect on the device.
+ */
+int
+SDL_HapticStopEffect(SDL_Haptic * haptic, int effect)
+{
+   if (!ValidHaptic(&haptic) || !ValidEffect(haptic,effect)) {
+      return -1;
+   }
+
+   /* Stop the effect */
+   if (SDL_SYS_HapticStopEffect(haptic,&haptic->effects[effect]) < 0) {
+      return -1;
+   }
+
+   return 0;
+}
+
+/*
  * Gets rid of a haptic effect.
  */
 void