diff options
author | chai <chaifix@163.com> | 2019-01-31 18:38:35 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-01-31 18:38:35 +0800 |
commit | 2ec55fd974a63b705a4777c256d2222c874fa043 (patch) | |
tree | 48f1fea59ee9fc713a28a9aac3f05b98dc5ae66f /Source/3rdParty/SDL2/include/SDL_gamecontroller.h | |
parent | c581dfbf1e849f393861d15e82aa6446c0c1c310 (diff) |
*SDL project
Diffstat (limited to 'Source/3rdParty/SDL2/include/SDL_gamecontroller.h')
-rw-r--r-- | Source/3rdParty/SDL2/include/SDL_gamecontroller.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/3rdParty/SDL2/include/SDL_gamecontroller.h b/Source/3rdParty/SDL2/include/SDL_gamecontroller.h index 2e024be..6ae9c95 100644 --- a/Source/3rdParty/SDL2/include/SDL_gamecontroller.h +++ b/Source/3rdParty/SDL2/include/SDL_gamecontroller.h @@ -176,6 +176,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); /** + * Get the mapping of a game controller. + * This can be called before any controllers are opened. + * + * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available + */ +extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index); + +/** * Open a game controller for use. * The index passed as an argument refers to the N'th game controller on the system. * This index is not the value which will identify this controller in future @@ -197,6 +205,13 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); /** + * Get the player index of an opened game controller, or -1 if it's not available + * + * For XInput controllers this returns the XInput user index. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); + +/** * Get the USB vendor ID of an opened controller, if available. * If the vendor ID isn't available this function returns 0. */ @@ -346,6 +361,19 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga SDL_GameControllerButton button); /** + * Trigger a rumble effect + * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling. + * + * \param gamecontroller The controller to vibrate + * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF + * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * + * \return 0, or -1 if rumble isn't supported on this joystick + */ +extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** * Close a controller previously opened with SDL_GameControllerOpen(). */ extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); |