Size: 1523
Comment: Added link to SDL_GameControllerAxis.
|
← Revision 3 as of 2015-02-18 21:28:13 ⇥
Size: 1602
Comment: Added note about trigger values.
|
Deletions are marked like this. | Additions are marked like this. |
Line 43: | Line 43: |
The state is a value ranging from -32768 to 32767. | The state is a value ranging from -32768 to 32767. Triggers, however, range from 0 to 32767 (they never return a negative value). |
DRAFT |
SDL_GameControllerGetAxis
Use this function to get the current state of an axis control on a game controller.
Contents
Syntax
Sint16 SDL_GameControllerGetAxis(SDL_GameController* gamecontroller,
SDL_GameControllerAxis axis)
Function Parameters
gamecontroller |
a game controller |
axis |
an axis index (one of the SDL_GameControllerAxis values) |
Return Value
Returns axis state (including 0) on success or 0 (also) on failure; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
The axis indices start at index 0.
The state is a value ranging from -32768 to 32767. Triggers, however, range from 0 to 32767 (they never return a negative value).
Version
This function is available since SDL 2.0.0.