include/SDL_joystick.h
changeset 12088 399cc39583cc
parent 11811 5d94cb6b24d3
child 12357 40f09c8c517b
     1.1 --- a/include/SDL_joystick.h	Wed Aug 08 15:39:20 2018 -0400
     1.2 +++ b/include/SDL_joystick.h	Thu Aug 09 16:00:17 2018 -0700
     1.3 @@ -97,10 +97,10 @@
     1.4  typedef enum
     1.5  {
     1.6      SDL_JOYSTICK_POWER_UNKNOWN = -1,
     1.7 -    SDL_JOYSTICK_POWER_EMPTY,
     1.8 -    SDL_JOYSTICK_POWER_LOW,
     1.9 -    SDL_JOYSTICK_POWER_MEDIUM,
    1.10 -    SDL_JOYSTICK_POWER_FULL,
    1.11 +    SDL_JOYSTICK_POWER_EMPTY,   /* <= 5% */
    1.12 +    SDL_JOYSTICK_POWER_LOW,     /* <= 20% */
    1.13 +    SDL_JOYSTICK_POWER_MEDIUM,  /* <= 70% */
    1.14 +    SDL_JOYSTICK_POWER_FULL,    /* <= 100% */
    1.15      SDL_JOYSTICK_POWER_WIRED,
    1.16      SDL_JOYSTICK_POWER_MAX
    1.17  } SDL_JoystickPowerLevel;
    1.18 @@ -362,6 +362,19 @@
    1.19                                                      int button);
    1.20  
    1.21  /**
    1.22 + *  Trigger a rumble effect
    1.23 + *  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
    1.24 + *
    1.25 + *  \param joystick The joystick to vibrate
    1.26 + *  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
    1.27 + *  \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
    1.28 + *  \param duration_ms The duration of the rumble effect, in milliseconds
    1.29 + *
    1.30 + *  \return 0, or -1 if rumble isn't supported on this joystick
    1.31 + */
    1.32 +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
    1.33 +
    1.34 +/**
    1.35   *  Close a joystick previously opened with SDL_JoystickOpen().
    1.36   */
    1.37  extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick);