|
⇤ ← Revision 1 as of 2010-03-16 20:20:18
Size: 756
Comment: create page, add content (Rev 5540)
|
Size: 1006
Comment: update content (old wiki)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 16: | Line 16: |
| ||'''device_index'''||the index of the joystick to query|| | ||'''device_index'''||^the index of the joystick to query^ ''-or-'' *the N'th joystick on the system*|| |
| Line 19: | Line 19: |
| 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. |
| Line 22: | Line 22: |
| * | |
| Line 23: | Line 24: |
| You can add your code example here | /* 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)); |
| Line 25: | Line 31: |
| * | |
| Line 30: | Line 37: |
| .[[SDL_JoystickOpen]] * |
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.
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.
