include/SDL_haptic.h
branchgsoc2008_force_feedback
changeset 2481 5d0ea4576f20
parent 2480 b883974445fc
child 2482 b51ad78812d5
     1.1 --- a/include/SDL_haptic.h	Tue Jul 01 09:22:22 2008 +0000
     1.2 +++ b/include/SDL_haptic.h	Tue Jul 01 10:44:42 2008 +0000
     1.3 @@ -57,9 +57,38 @@
     1.4  #define SDL_HAPTIC_GAIN       (1<<8)
     1.5  #define SDL_HAPTIC_AUTOCENTER (1<<9)
     1.6  
     1.7 +typedef enum SDL_waveform {
     1.8 +   SDL_WAVEFORM_SINE,
     1.9 +   SDL_WAVEFORM_SQUARE,
    1.10 +   SDL_WAVEFORM_TRIANGLE,
    1.11 +   SDL_WAVEFORM_SAWTOOTHUP,
    1.12 +   SDL_WAVEFORM_SAWTOOTHDOWN
    1.13 +} SDL_waveform;
    1.14 +
    1.15 +
    1.16 +/*
    1.17 + * All values max at 32767 (0x7fff).  Signed values also can be negative.
    1.18 + * Time values unless specified otherwise are in milliseconds.
    1.19 + *
    1.20 + * Common parts:
    1.21 + * 
    1.22 + * Replay:
    1.23 + *    Uint16 length;    Duration of effect.
    1.24 + *    Uint16 delay;     Delay before starting effect.
    1.25 + *
    1.26 + * Trigger:
    1.27 + *    Uint16 button;    Button that triggers effect.
    1.28 + *    Uint16 interval;  How soon before effect can be triggered again.
    1.29 + *
    1.30 + * Envelope:
    1.31 + *    Uint16 attack_length;   Duration of the attack.
    1.32 + *    Uint16 attack_level;    Level at the start of the attack.
    1.33 + *    Uint16 fade_length;     Duration of the fade out.
    1.34 + *    Uint16 fade_level;      Level at the end of the fade.
    1.35 + */
    1.36  typedef struct SDL_HapticConstant {
    1.37     /* Header */
    1.38 -   Uint16 type;
    1.39 +   Uint16 type; /* SDL_HAPTIC_CONSTANT */
    1.40     Uint16 direction;
    1.41  
    1.42     /* Replay */
    1.43 @@ -71,7 +100,7 @@
    1.44     Uint16 interval;
    1.45  
    1.46     /* Constant */
    1.47 -   Sint16 level;
    1.48 +   Sint16 level; /* Strength of the constant effect. */
    1.49  
    1.50     /* Envelope */
    1.51     Uint16 attack_length;
    1.52 @@ -81,7 +110,7 @@
    1.53  } SDL_HapticConstant;
    1.54  typedef struct SDL_HapticPeriodic {
    1.55     /* Header */
    1.56 -   Uint16 type;
    1.57 +   Uint16 type; /* SDL_HAPTIC_PERIODIC */
    1.58     Uint16 direction;
    1.59  
    1.60     /* Replay */
    1.61 @@ -93,11 +122,11 @@
    1.62     Uint16 interval;
    1.63  
    1.64     /* Periodic */
    1.65 -   Uint16 waveform;
    1.66 -   Uint16 period;
    1.67 -   Sint16 magnitude;
    1.68 -   Sint16 offset;
    1.69 -   Uint16 phase;
    1.70 +   SDL_waveform waveform; /* Type of effect */
    1.71 +   Uint16 period; /* Period of the wave */
    1.72 +   Sint16 magnitude; /* Peak value */
    1.73 +   Sint16 offset; /* Mean value of the wave */
    1.74 +   Uint16 phase; /* Horizontal shift */
    1.75  
    1.76     /* Envelope */
    1.77     Uint16 attack_length;