diff src/haptic/linux/SDL_syshaptic.c @ 2495:66c02abeef0e gsoc2008_force_feedback

Added SDL_HapticGetEffectStatus(). More comments.
author Edgar Simo <bobbens@gmail.com>
date Thu, 03 Jul 2008 09:58:27 +0000
parents 6a2482d4af81
children 8f840a6cdf01
line wrap: on
line diff
--- a/src/haptic/linux/SDL_syshaptic.c	Thu Jul 03 09:13:22 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Thu Jul 03 09:58:27 2008 +0000
@@ -612,6 +612,31 @@
 
 
 /*
+ * Gets the status of a haptic effect.
+ */
+int
+SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect)
+{
+#if 0  /* Not supported atm. */
+   struct input_event ie;
+
+   ie.type = EV_FF;
+   ie.type = EV_FF_STATUS;
+   ie.code = effect->hweffect->effect.id;
+
+   if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
+      SDL_SetError("Error getting haptic device status.");
+      return -1;
+   }
+
+   return 0;
+#endif
+
+   return -1;
+}
+
+
+/*
  * Sets the gain.
  */
 int