|
Size: 1135
Comment: Changed argument to SDL_Joystick*.
|
Size: 1082
Comment: I don't think this can be called without SDL_JoystickOpen. SDL_JoystickNameForIndex could, though.
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 37: | Line 37: |
| This can be called before any joysticks are opened. |
DRAFT |
SDL_JoystickName
Use this function to get the implementation dependent name of a joystick.
Contents
Syntax
const char* SDL_JoystickName(SDL_Joystick *joystick)
Function Parameters
joystick |
^the SDL_Joystick obtained from SDL_JoystickOpen |
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++)
{
SDL_Joystick *joystick = SDL_JoystickOpen(i);
printf("%s\n", SDL_JoystickName(joystick));
}
*
Remarks
