Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2013-02-07 15:19:18
Size: 1101
Comment: Copied from SDL_JoystickName rev 2.
Revision 2 as of 2013-02-11 18:17:24
Size: 1082
Comment: Cleaned up stray marks
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
||'''device_index'''||^the index of the joystick to query^ ''-or-'' *the N'th joystick on the system*|| ||'''device_index'''||the index of the joystick to query (the N'th joystick on the system)||
Line 22: Line 22:
*
Line 31: Line 31:
*
Line 37: Line 36:
 .[[SDL_JoystickOpen]] *
 .[[SDL_JoystickName]] *
 .[[SDL_JoystickOpen]]
 .[[SDL_JoystickName]]

DRAFT

SDL_JoystickNameForIndex

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

Syntax

const char* SDL_JoystickNameForIndex(int device_index)

Function Parameters

device_index

the index of the joystick to query (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_JoystickNameForIndex(i));

Remarks

This can be called before any joysticks are opened.


CategoryAPI, CategoryJoystick

None: SDL_JoystickNameForIndex (last edited 2015-04-26 18:55:03 by PhilippWiesemann)

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