|
Size: 1401
Comment: Fixed pointer style in Syntax section, see SGFunctions.
|
Size: 1403
Comment: Added missing ().
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 42: | Line 42: |
| joystick_index is the same as the device_index passed to [[SDL_JoystickOpen]]. | joystick_index is the same as the device_index passed to [[SDL_JoystickOpen]](). |
DRAFT |
SDL_GameControllerNameForIndex
Use this function to get the implementation dependent name for the game controller.
Contents
Syntax
const char* SDL_GameControllerNameForIndex(int joystick_index)
Function Parameters
joystick_index |
the device_index of a device, up to SDL_NumJoysticks() |
Return Value
Returns the implementation dependent name for the game controller, or NULL if there is no name or the index is invalid.
Code Examples
for (int i = 0; i < SDL_NumJoysticks(); ++i) {
const char *name = SDL_GameControllerNameForIndex(i);
if (name) {
printf("Joystick %i has game controller name '%s'\n", i, name);
} else {
printf("Joystick %i has no game controller name.\n", i);
}
}
Remarks
joystick_index is the same as the device_index passed to SDL_JoystickOpen().
