diff include/SDL_haptic.h @ 2482:b51ad78812d5 gsoc2008_force_feedback

Removed the linux only SDL_HAPTIC_RUMBLE (use PERIODIC instead). Added and partially implemented CONDITION and RAMP effects.
author Edgar Simo <bobbens@gmail.com>
date Tue, 01 Jul 2008 11:21:36 +0000
parents 5d0ea4576f20
children 9d52368ebcf5
line wrap: on
line diff
--- a/include/SDL_haptic.h	Tue Jul 01 10:44:42 2008 +0000
+++ b/include/SDL_haptic.h	Tue Jul 01 11:21:36 2008 +0000
@@ -52,10 +52,9 @@
 #define SDL_HAPTIC_SPRING     (1<<3)
 #define SDL_HAPTIC_FRICTION   (1<<4)
 #define SDL_HAPTIC_DAMPER     (1<<5)
-#define SDL_HAPTIC_RUMBLE     (1<<6)
-#define SDL_HAPTIC_INERTIA    (1<<7)
-#define SDL_HAPTIC_GAIN       (1<<8)
-#define SDL_HAPTIC_AUTOCENTER (1<<9)
+#define SDL_HAPTIC_INERTIA    (1<<6)
+#define SDL_HAPTIC_GAIN       (1<<7)
+#define SDL_HAPTIC_AUTOCENTER (1<<8)
 
 typedef enum SDL_waveform {
    SDL_WAVEFORM_SINE,
@@ -134,12 +133,60 @@
    Uint16 fade_length;
    Uint16 fade_level;
 } SDL_HapticPeriodic;
+typedef struct SDL_HapticCondition {
+   /* Header */
+   Uint16 type; /* SDL_HAPTIC_{SPRING,DAMPER,INERTIA,FRICTION} */
+   Uint16 direction;
+
+   /* Replay */
+   Uint16 length;
+   Uint16 delay;
+
+   /* Trigger */
+   Uint16 button;
+   Uint16 interval;
+
+   /* Condition */
+   Uint16 right_sat; /* Level when joystick is to the right. */
+   Uint16 left_sat; /* Level when joystick is to the left */
+   Sint16 right_coeff; /* How fast to increase the force towards the right */
+   Sint16 left_coeff; /* How fast to increase the force towards the left */
+   Uint16 deadband; /* Size of the dead zone */
+   Sint16 center; /* Position of the dead zone */
+
+} SDL_HapticCondition;
+typedef struct SDL_HapticRamp {
+   /* Header */
+   Uint16 type; /* SDL_HAPTIC_RAMP */
+   Uint16 direction;
+
+   /* Replay */
+   Uint16 length;
+   Uint16 delay;
+
+   /* Trigger */
+   Uint16 button;
+   Uint16 interval;
+
+   /* Ramp */
+   Sint16 start;
+   Sint16 end;
+
+   /* Envelope */
+   Uint16 attack_length;
+   Uint16 attack_level;
+   Uint16 fade_length;
+   Uint16 fade_level;
+
+} SDL_HapticRamp;
 
 typedef union SDL_HapticEffect {
    /* Common for all force feedback effects */
    Uint16 type; /* Effect type */
    SDL_HapticConstant constant; /* Constant effect */
    SDL_HapticPeriodic periodic; /* Periodic effect */
+   SDL_HapticCondition condition; /* Condition effect */
+   SDL_HapticRamp ramp; /* Ramp effect */
 } SDL_HapticEffect;