diff include/SDL_haptic.h @ 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 66c02abeef0e
line wrap: on
line diff
--- a/include/SDL_haptic.h	Tue Jul 01 18:35:05 2008 +0000
+++ b/include/SDL_haptic.h	Wed Jul 02 08:24:35 2008 +0000
@@ -31,6 +31,7 @@
 
 #include "SDL_stdinc.h"
 #include "SDL_error.h"
+#include "SDL_joystick.h"
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
@@ -207,6 +208,22 @@
  */
 extern DECLSPEC SDL_Haptic * SDL_HapticOpen(int device_index);
 
+/*
+ * Checks to see if a joystick has haptic features.
+ *
+ * Returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
+ * and -1 on error.
+ */
+extern DECLSPEC int SDL_JoystickIsHaptic(SDL_Joystick * joystick);
+
+/*
+ * Opens a Haptic device for usage from a Joystick device.
+ *
+ * Returns a valid pointer to a haptic device on success or NULL
+ * if an error occurred.
+ */
+extern DECLSPEC SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick);
+
 /* 
  * Closes a Haptic device previously opened with SDL_HapticOpen.
  */