mirror of
https://github.com/yawut/SDL.git
synced 2026-04-22 00:27:21 -05:00
Print stick GUID in testjoystick.
This commit is contained in:
parent
7e8d1988f8
commit
9148ea5edb
|
|
@ -219,11 +219,15 @@ main(int argc, char *argv[])
|
|||
fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i,
|
||||
SDL_GetError());
|
||||
} else {
|
||||
JoystickGUID guid = SDL_JoystickGetGUID(joystick);
|
||||
char *guidstr = SDL_JoystickGetGUIDString(guid);
|
||||
printf(" axes: %d\n", SDL_JoystickNumAxes(joystick));
|
||||
printf(" balls: %d\n", SDL_JoystickNumBalls(joystick));
|
||||
printf(" hats: %d\n", SDL_JoystickNumHats(joystick));
|
||||
printf(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
|
||||
printf("instance id: %d\n", SDL_JoystickInstanceID(joystick));
|
||||
printf(" guid: %s\n", guidstr);
|
||||
SDL_free(guidstr);
|
||||
SDL_JoystickClose(joystick);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user