Subversion Repository Public Repository

Divide-Dependencies

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 101 vs 102 for /sdl/include/SDL_joystick.h

Diff revisions: vs.
  @@ -97,10 +97,10 @@
97 97 typedef enum
98 98 {
99 99 SDL_JOYSTICK_POWER_UNKNOWN = -1,
100 - SDL_JOYSTICK_POWER_EMPTY,
101 - SDL_JOYSTICK_POWER_LOW,
102 - SDL_JOYSTICK_POWER_MEDIUM,
103 - SDL_JOYSTICK_POWER_FULL,
100 + SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */
101 + SDL_JOYSTICK_POWER_LOW, /* <= 20% */
102 + SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */
103 + SDL_JOYSTICK_POWER_FULL, /* <= 100% */
104 104 SDL_JOYSTICK_POWER_WIRED,
105 105 SDL_JOYSTICK_POWER_MAX
106 106 } SDL_JoystickPowerLevel;
  @@ -133,6 +133,12 @@
133 133 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
134 134
135 135 /**
136 + * Get the player index of a joystick, or -1 if it's not available
137 + * This can be called before any joysticks are opened.
138 + */
139 + extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
140 +
141 + /**
136 142 * Return the GUID for the joystick at this index
137 143 * This can be called before any joysticks are opened.
138 144 */
  @@ -195,6 +201,13 @@
195 201 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
196 202
197 203 /**
204 + * Get the player index of an opened joystick, or -1 if it's not available
205 + *
206 + * For XInput controllers this returns the XInput user index.
207 + */
208 + extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick);
209 +
210 + /**
198 211 * Return the GUID for this opened joystick
199 212 */
200 213 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick);
  @@ -362,6 +375,19 @@
362 375 int button);
363 376
364 377 /**
378 + * Trigger a rumble effect
379 + * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
380 + *
381 + * \param joystick The joystick to vibrate
382 + * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
383 + * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
384 + * \param duration_ms The duration of the rumble effect, in milliseconds
385 + *
386 + * \return 0, or -1 if rumble isn't supported on this joystick
387 + */
388 + extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
389 +
390 + /**
365 391 * Close a joystick previously opened with SDL_JoystickOpen().
366 392 */
367 393 extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick);