src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2478 4fd783e0f34b
parent 2477 97f75ea43a93
child 2479 b9eb2cfe16cd
--- a/src/haptic/SDL_haptic.c	Mon Jun 30 16:48:16 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Mon Jun 30 17:28:34 2008 +0000
@@ -197,6 +197,43 @@
    }
 }
 
+/*
+ * Returns the number of effects a haptic device has.
+ */
+int
+SDL_HapticNumEffects(SDL_Haptic * haptic)
+{
+   if (!ValidHaptic(&haptic)) {
+      return -1;
+   }
+
+   return haptic->neffects;
+}
+
+/*
+ * Returns supported effects by the device.
+ */
+unsigned int
+SDL_HapticQueryEffects(SDL_Haptic * haptic)
+{
+   if (!ValidHaptic(&haptic)) {
+      return -1;
+   }
+
+   return haptic->supported;
+}
+
+int
+SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect)
+{
+   if (!ValidHaptic(&haptic)) {
+      return -1;
+   }
+
+   if ((haptic->supported & effect->type) != 0)
+      return SDL_TRUE;
+   return SDL_FALSE;
+}
 
 /*
  * Creates a new haptic effect.