src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2495 66c02abeef0e
parent 2491 10bc7aaf5114
child 2497 0893fbf73b3d
--- a/src/haptic/SDL_haptic.c	Thu Jul 03 09:13:22 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Thu Jul 03 09:58:27 2008 +0000
@@ -438,6 +438,24 @@
 }
 
 /*
+ * Gets the status of a haptic effect.
+ */
+int
+SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
+{
+   if (!ValidHaptic(&haptic) || !ValidEffect(haptic,effect)) {
+      return -1;
+   }
+
+   if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
+      SDL_SetError("Haptic device does not support status queries.");
+      return -1;
+   }
+
+   return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
+}
+
+/*
  * Sets the global gain of the device.
  */
 int