Skip to content

Commit

Permalink
Fixed hotplug with more than one device in testjoystick program.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Dec 16, 2016
1 parent 0a3f9d0 commit b515b34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/testjoystick.c
Expand Up @@ -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);
Expand Down

0 comments on commit b515b34

Please sign in to comment.