Patched testjoystick.c to compile.
This commit is contained in:
parent
3da6d29ab7
commit
c773de800d
1 changed files with 4 additions and 4 deletions
|
@ -219,15 +219,15 @@ main(int argc, char *argv[])
|
||||||
fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i,
|
fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i,
|
||||||
SDL_GetError());
|
SDL_GetError());
|
||||||
} else {
|
} else {
|
||||||
JoystickGUID guid = SDL_JoystickGetGUID(joystick);
|
char guid[64];
|
||||||
char *guidstr = SDL_JoystickGetGUIDString(guid);
|
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick),
|
||||||
|
guid, sizeof (guid));
|
||||||
printf(" axes: %d\n", SDL_JoystickNumAxes(joystick));
|
printf(" axes: %d\n", SDL_JoystickNumAxes(joystick));
|
||||||
printf(" balls: %d\n", SDL_JoystickNumBalls(joystick));
|
printf(" balls: %d\n", SDL_JoystickNumBalls(joystick));
|
||||||
printf(" hats: %d\n", SDL_JoystickNumHats(joystick));
|
printf(" hats: %d\n", SDL_JoystickNumHats(joystick));
|
||||||
printf(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
|
printf(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
|
||||||
printf("instance id: %d\n", SDL_JoystickInstanceID(joystick));
|
printf("instance id: %d\n", SDL_JoystickInstanceID(joystick));
|
||||||
printf(" guid: %s\n", guidstr);
|
printf(" guid: %s\n", guid);
|
||||||
SDL_free(guidstr);
|
|
||||||
SDL_JoystickClose(joystick);
|
SDL_JoystickClose(joystick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue