diff include/SDL_haptic.h @ 2477:97f75ea43a93 gsoc2008_force_feedback

Starting to add infrastructure to handle haptic effects.
author Edgar Simo <bobbens@gmail.com>
date Mon, 30 Jun 2008 16:48:16 +0000
parents 242d8a668ebb
children 4fd783e0f34b
line wrap: on
line diff
--- 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