Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2013-02-07 15:21:17
Size: 1082
Comment: I don't think this can be called without SDL_JoystickOpen. SDL_JoystickNameForIndex could, though.
Revision 6 as of 2013-02-11 18:17:51
Size: 1073
Comment: Cleaned up stray marks
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
||'''joystick'''||^the [[SDL_Joystick]] obtained from [[SDL_JoystickOpen]] || ||'''joystick'''||the [[SDL_Joystick]] obtained from [[SDL_JoystickOpen]] ||
Line 22: Line 22:
*
Line 34: Line 34:
*
Line 39: Line 38:
 .[[SDL_JoystickOpen]] *
 .[[SDL_JoystickNameForIndex]] *
 .[[SDL_JoystickOpen]]
 .[[SDL_JoystickNameForIndex]]

DRAFT

SDL_JoystickName

Use this function to get the implementation dependent name of a joystick.

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


CategoryAPI, CategoryJoystick

None: SDL_JoystickName (last edited 2015-04-26 18:55:49 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit