include/SDL_haptic.h
branchgsoc2008_force_feedback
changeset 2477 97f75ea43a93
parent 2476 242d8a668ebb
child 2478 4fd783e0f34b
--- a/include/SDL_haptic.h	Mon Jun 23 09:01:58 2008 +0000
+++ b/include/SDL_haptic.h	Mon Jun 30 16:48:16 2008 +0000
@@ -57,6 +57,20 @@
 #define SDL_HAPTIC_GAIN       (1<<8)
 #define SDL_HAPTIC_AUTOCENTER (1<<9)
 
+typedef struct SDL_HapticConstant {
+   /* Header */
+   Uint16 type;
+   Uint16 length;
+   Uint16 delay;
+   Uint16 direction;
+} SDL_HapticConstant;
+
+typedef union SDL_HapticEffect {
+   /* Common for all force feedback effects */
+   Uint16 type; /* Effect type */
+   SDL_HapticConstant constant; /* Constant effect */
+} SDL_HapticEffect;
+
 
 /* Function prototypes */
 /*
@@ -85,6 +99,21 @@
  */
 extern DECLSPEC void SDL_HapticClose(SDL_Haptic * haptic);
 
+/*
+ * Creates a new haptic effect on the device.
+ */
+extern DECLSPEC int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect);
+
+/*
+ * Runs the haptic effect on it's assosciated haptic device.
+ */
+extern DECLSPEC int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect);
+
+/*
+ * Destroys a haptic effect on the device.
+ */
+extern DECLSPEC void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect);
+
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus