diff src/haptic/SDL_haptic.c @ 2506:ba8e99fe92c1 gsoc2008_force_feedback

Added SDL_HapticOpened().
author Edgar Simo <bobbens@gmail.com>
date Tue, 08 Jul 2008 19:35:10 +0000
parents abfcba0f3bd1
children 8ef1d0f4d0c1
line wrap: on
line diff
--- a/src/haptic/SDL_haptic.c	Tue Jul 08 19:23:03 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Tue Jul 08 19:35:10 2008 +0000
@@ -149,6 +149,25 @@
 
 
 /*
+ * Returns 1 if the device has been opened.
+ */
+int
+SDL_HapticOpened(int device_index)
+{
+   int i, opened;
+
+   opened = 0;
+   for (i=0; SDL_haptics[i]; i++) {
+      if (SDL_haptics[i]->index == (Uint8) device_index) {
+         opened = 1;
+         break;
+      }
+   }
+   return opened;
+}
+
+
+/*
  * Returns the index to a haptic device.
  */
 int