diff src/haptic/linux/SDL_syshaptic.c @ 2489:96adc8025331 gsoc2008_force_feedback

Exposed some of the joystick stuff to the haptic subsystem. Added SDL_JoystickIsHaptic().
author Edgar Simo <bobbens@gmail.com>
date Wed, 02 Jul 2008 08:24:35 +0000
parents 8e2bdbccf7ff
children be9b206d44af
line wrap: on
line diff
--- a/src/haptic/linux/SDL_syshaptic.c	Tue Jul 01 18:35:05 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Wed Jul 02 08:24:35 2008 +0000
@@ -26,6 +26,9 @@
 #include "SDL_haptic.h"
 #include "../SDL_haptic_c.h"
 #include "../SDL_syshaptic.h"
+#include "SDL_joystick.h"
+#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */
+#include "../../joystick/linux/SDL_sysjoystick_c.h" /* For joystick hwdata */ 
 
 #include <unistd.h> /* close */
 #include <linux/input.h>
@@ -244,6 +247,27 @@
 
 
 /*
+ * Checks to see if a joystick has haptic features.
+ */
+int
+SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
+{
+   if (EV_IsHaptic(joystick->hwdata->fd) > 0)
+      return 1;
+   return 0;
+}
+
+
+/*
+ * Opens a SDL_Haptic from a SDL_Joystick.
+ */
+int
+SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
+{
+}
+
+
+/*
  * Closes the haptic device.
  */
 void
@@ -604,5 +628,4 @@
 }
 
 
-
 #endif /* SDL_HAPTIC_LINUX */