include/SDL_haptic.h
branchgsoc2008_force_feedback
changeset 2495 66c02abeef0e
parent 2489 96adc8025331
child 2497 0893fbf73b3d
     1.1 --- a/include/SDL_haptic.h	Thu Jul 03 09:13:22 2008 +0000
     1.2 +++ b/include/SDL_haptic.h	Thu Jul 03 09:58:27 2008 +0000
     1.3 @@ -46,22 +46,25 @@
     1.4  typedef struct _SDL_Haptic SDL_Haptic;
     1.5  
     1.6  
     1.7 -/* Different effects that can be generated */
     1.8 -#define SDL_HAPTIC_CONSTANT   (1<<0)
     1.9 -#define SDL_HAPTIC_SINE       (1<<1)
    1.10 -#define SDL_HAPTIC_SQUARE     (1<<2)
    1.11 -#define SDL_HAPTIC_TRIANGLE   (1<<3)
    1.12 -#define SDL_HAPTIC_SAWTOOTHUP (1<<4)
    1.13 -#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)
    1.14 -#define SDL_HAPTIC_RAMP       (1<<6)
    1.15 -#define SDL_HAPTIC_SPRING     (1<<7)
    1.16 -#define SDL_HAPTIC_FRICTION   (1<<8)
    1.17 -#define SDL_HAPTIC_DAMPER     (1<<9)
    1.18 -#define SDL_HAPTIC_INERTIA    (1<<10)
    1.19 -#define SDL_HAPTIC_CUSTOM     (1<<11)
    1.20 +/*
    1.21 + * Different haptic features a device can have.
    1.22 + */
    1.23 +#define SDL_HAPTIC_CONSTANT   (1<<0) /* Constant effect supported */
    1.24 +#define SDL_HAPTIC_SINE       (1<<1) /* Sine wave effect supported */
    1.25 +#define SDL_HAPTIC_SQUARE     (1<<2) /* Square wave effect supported */
    1.26 +#define SDL_HAPTIC_TRIANGLE   (1<<3) /* Triangle wave effect supported */
    1.27 +#define SDL_HAPTIC_SAWTOOTHUP (1<<4) /* Sawtoothup wave effect supported */
    1.28 +#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) /* Sawtoothdown wave effect supported */
    1.29 +#define SDL_HAPTIC_RAMP       (1<<6) /* Ramp effect supported */
    1.30 +#define SDL_HAPTIC_SPRING     (1<<7) /* Spring effect supported - uses axes position */
    1.31 +#define SDL_HAPTIC_DAMPER     (1<<8) /* Damper effect supported - uses axes velocity */
    1.32 +#define SDL_HAPTIC_INERTIA    (1<<9) /* Inertia effect supported - uses axes acceleration */
    1.33 +#define SDL_HAPTIC_FRICTION   (1<<10) /* Friction effect supported - uses axes movement */
    1.34 +#define SDL_HAPTIC_CUSTOM     (1<<11) /* Custom effect is supported */
    1.35  /* These last two are features the device has, not effects */
    1.36 -#define SDL_HAPTIC_GAIN       (1<<12)
    1.37 -#define SDL_HAPTIC_AUTOCENTER (1<<13)
    1.38 +#define SDL_HAPTIC_GAIN       (1<<12) /* Device can set global gain */
    1.39 +#define SDL_HAPTIC_AUTOCENTER (1<<13) /* Device can set autocenter */
    1.40 +#define SDL_HAPTIC_STATUS     (1<<14) /* Device can be queried for effect status */
    1.41  
    1.42  
    1.43  /*
    1.44 @@ -166,8 +169,8 @@
    1.45     Uint16 interval;
    1.46  
    1.47     /* Ramp */
    1.48 -   Sint16 start;
    1.49 -   Sint16 end;
    1.50 +   Sint16 start; /* Beginning strength level. */
    1.51 +   Sint16 end; /* Ending strength level. */
    1.52  
    1.53     /* Envelope */
    1.54     Uint16 attack_length;
    1.55 @@ -288,6 +291,14 @@
    1.56  extern DECLSPEC void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect);
    1.57  
    1.58  /*
    1.59 + * Gets the status of the current effect on the haptic device.
    1.60 + *
    1.61 + * Returns 0 if it isn't playing, SDL_HAPTIC_PLAYING if it is playing
    1.62 + * or -1 on failure.
    1.63 + */
    1.64 +extern DECLSPEC int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect);
    1.65 +
    1.66 +/*
    1.67   * Sets the global gain of the device.  Gain should be between 0 and 100.
    1.68   *
    1.69   * Returns 0 on success or -1 on failure.