Fixed hotplug with more than one device in testjoystick program.

This commit is contained in:
Philipp Wiesemann 2016-12-16 22:58:32 +01:00
parent 0a3f9d0cfb
commit b515b34dbb
1 changed files with 1 additions and 0 deletions

View File

@ -321,6 +321,7 @@ main(int argc, char *argv[])
|| (event.type == SDL_MOUSEBUTTONDOWN)) {
keepGoing = SDL_FALSE;
} else if (event.type == SDL_JOYDEVICEADDED) {
device = event.jdevice.which;
joystick = SDL_JoystickOpen(device);
if (joystick != NULL) {
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);