include/SDL_haptic.h
changeset 7621 5caa5fb3deb6
parent 7620 c99a31e02b7a
child 7630 c711a2f14814
     1.1 --- a/include/SDL_haptic.h	Sat Aug 10 13:20:45 2013 -0400
     1.2 +++ b/include/SDL_haptic.h	Sat Aug 10 13:38:09 2013 -0400
     1.3 @@ -166,13 +166,18 @@
     1.4  #define SDL_HAPTIC_SINE       (1<<1)
     1.5  
     1.6  /**
     1.7 - *  \brief Square wave effect supported.
     1.8 + *  \brief Left/Right effect supported.
     1.9   *
    1.10 - *  Periodic haptic effect that simulates square waves.
    1.11 + *  Haptic effect for direct control over high/low frequency motors.
    1.12   *
    1.13 - *  \sa SDL_HapticPeriodic
    1.14 + *  \sa SDL_HapticLeftRight
    1.15 + * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
    1.16 + *          we ran out of bits, and this is important for XInput devices.
    1.17   */
    1.18 -#define SDL_HAPTIC_SQUARE     (1<<2)
    1.19 +#define SDL_HAPTIC_LEFTRIGHT     (1<<2)
    1.20 +
    1.21 +/* !!! FIXME: put this back when we have more bits in 2.1 */
    1.22 +/*#define SDL_HAPTIC_SQUARE     (1<<2)*/
    1.23  
    1.24  /**
    1.25   *  \brief Triangle wave effect supported.
    1.26 @@ -646,6 +651,31 @@
    1.27  } SDL_HapticRamp;
    1.28  
    1.29  /**
    1.30 + * \brief A structure containing a template for a Left/Right effect.
    1.31 + *
    1.32 + * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
    1.33 + *
    1.34 + * The Left/Right effect is used to explicitly control the large and small
    1.35 + * motors, commonly found in modern game controllers. One motor is high
    1.36 + * frequency, the other is low frequency.
    1.37 + *
    1.38 + * \sa SDL_HAPTIC_LEFTRIGHT
    1.39 + * \sa SDL_HapticEffect
    1.40 + */
    1.41 +typedef struct SDL_HapticLeftRight
    1.42 +{
    1.43 +    /* Header */
    1.44 +    Uint16 type;            /**< ::SDL_HAPTIC_LEFTRIGHT */
    1.45 +
    1.46 +    /* Replay */
    1.47 +    Uint32 length;          /**< Duration of the effect. */
    1.48 +
    1.49 +    /* Rumble */
    1.50 +    Uint16 large_magnitude; /**< Control of the large controller motor. */
    1.51 +    Uint16 small_magnitude; /**< Control of the small controller motor. */
    1.52 +} SDL_HapticLeftRight;
    1.53 +
    1.54 +/**
    1.55   *  \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
    1.56   *
    1.57   *  A custom force feedback effect is much like a periodic effect, where the
    1.58 @@ -751,6 +781,7 @@
    1.59   *  \sa SDL_HapticPeriodic
    1.60   *  \sa SDL_HapticCondition
    1.61   *  \sa SDL_HapticRamp
    1.62 + *  \sa SDL_HapticLeftRight
    1.63   *  \sa SDL_HapticCustom
    1.64   */
    1.65  typedef union SDL_HapticEffect
    1.66 @@ -761,6 +792,7 @@
    1.67      SDL_HapticPeriodic periodic;    /**< Periodic effect. */
    1.68      SDL_HapticCondition condition;  /**< Condition effect. */
    1.69      SDL_HapticRamp ramp;            /**< Ramp effect. */
    1.70 +    SDL_HapticLeftRight leftright;  /**< Left/Right effect. */
    1.71      SDL_HapticCustom custom;        /**< Custom effect. */
    1.72  } SDL_HapticEffect;
    1.73  
    1.74 @@ -1182,8 +1214,6 @@
    1.75   */
    1.76  extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
    1.77  
    1.78 -
    1.79 -
    1.80  /* Ends C function definitions when using C++ */
    1.81  #ifdef __cplusplus
    1.82  }