include/SDL_haptic.h
branchgsoc2008_force_feedback
changeset 2482 b51ad78812d5
parent 2481 5d0ea4576f20
child 2483 9d52368ebcf5
     1.1 --- a/include/SDL_haptic.h	Tue Jul 01 10:44:42 2008 +0000
     1.2 +++ b/include/SDL_haptic.h	Tue Jul 01 11:21:36 2008 +0000
     1.3 @@ -52,10 +52,9 @@
     1.4  #define SDL_HAPTIC_SPRING     (1<<3)
     1.5  #define SDL_HAPTIC_FRICTION   (1<<4)
     1.6  #define SDL_HAPTIC_DAMPER     (1<<5)
     1.7 -#define SDL_HAPTIC_RUMBLE     (1<<6)
     1.8 -#define SDL_HAPTIC_INERTIA    (1<<7)
     1.9 -#define SDL_HAPTIC_GAIN       (1<<8)
    1.10 -#define SDL_HAPTIC_AUTOCENTER (1<<9)
    1.11 +#define SDL_HAPTIC_INERTIA    (1<<6)
    1.12 +#define SDL_HAPTIC_GAIN       (1<<7)
    1.13 +#define SDL_HAPTIC_AUTOCENTER (1<<8)
    1.14  
    1.15  typedef enum SDL_waveform {
    1.16     SDL_WAVEFORM_SINE,
    1.17 @@ -134,12 +133,60 @@
    1.18     Uint16 fade_length;
    1.19     Uint16 fade_level;
    1.20  } SDL_HapticPeriodic;
    1.21 +typedef struct SDL_HapticCondition {
    1.22 +   /* Header */
    1.23 +   Uint16 type; /* SDL_HAPTIC_{SPRING,DAMPER,INERTIA,FRICTION} */
    1.24 +   Uint16 direction;
    1.25 +
    1.26 +   /* Replay */
    1.27 +   Uint16 length;
    1.28 +   Uint16 delay;
    1.29 +
    1.30 +   /* Trigger */
    1.31 +   Uint16 button;
    1.32 +   Uint16 interval;
    1.33 +
    1.34 +   /* Condition */
    1.35 +   Uint16 right_sat; /* Level when joystick is to the right. */
    1.36 +   Uint16 left_sat; /* Level when joystick is to the left */
    1.37 +   Sint16 right_coeff; /* How fast to increase the force towards the right */
    1.38 +   Sint16 left_coeff; /* How fast to increase the force towards the left */
    1.39 +   Uint16 deadband; /* Size of the dead zone */
    1.40 +   Sint16 center; /* Position of the dead zone */
    1.41 +
    1.42 +} SDL_HapticCondition;
    1.43 +typedef struct SDL_HapticRamp {
    1.44 +   /* Header */
    1.45 +   Uint16 type; /* SDL_HAPTIC_RAMP */
    1.46 +   Uint16 direction;
    1.47 +
    1.48 +   /* Replay */
    1.49 +   Uint16 length;
    1.50 +   Uint16 delay;
    1.51 +
    1.52 +   /* Trigger */
    1.53 +   Uint16 button;
    1.54 +   Uint16 interval;
    1.55 +
    1.56 +   /* Ramp */
    1.57 +   Sint16 start;
    1.58 +   Sint16 end;
    1.59 +
    1.60 +   /* Envelope */
    1.61 +   Uint16 attack_length;
    1.62 +   Uint16 attack_level;
    1.63 +   Uint16 fade_length;
    1.64 +   Uint16 fade_level;
    1.65 +
    1.66 +} SDL_HapticRamp;
    1.67  
    1.68  typedef union SDL_HapticEffect {
    1.69     /* Common for all force feedback effects */
    1.70     Uint16 type; /* Effect type */
    1.71     SDL_HapticConstant constant; /* Constant effect */
    1.72     SDL_HapticPeriodic periodic; /* Periodic effect */
    1.73 +   SDL_HapticCondition condition; /* Condition effect */
    1.74 +   SDL_HapticRamp ramp; /* Ramp effect */
    1.75  } SDL_HapticEffect;
    1.76  
    1.77