|
Size: 1006
Comment: update content (old wiki)
|
Size: 1052
Comment: update content for consistency - add SDL_GetError() to NULL RVs
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 19: | Line 19: |
| Returns the name of the selected joystick. If no name can be found, this function returns NULL. | Returns the name of the selected joystick. If no name can be found, this function returns NULL; call [[SDL_GetError]]() for more information. |
DRAFT |
SDL_JoystickName
Use this function to get the implementation dependent name of a joystick.
Contents
Syntax
const char* SDL_JoystickName(int device_index)
Function Parameters
device_index |
the index of the joystick to query -or- *the N'th joystick on the system* |
Return Value
Returns the name of the selected joystick. If no name can be found, this function returns NULL; call SDL_GetError() for more information.
Code Examples
*
/* Print the names of all attached joysticks */
int num_joy, i;
num_joy=SDL_NumJoysticks();
printf("%d joysticks found\n", num_joy);
for(i=0;i<num_joy;i++)
printf("%s\n", SDL_JoystickName(i));
*
Remarks
This can be called before any joysticks are opened.
