Răsfoiți Sursa

Fixed hotplug with more than one device in testjoystick program.

Philipp Wiesemann 8 ani în urmă
părinte
comite
b515b34dbb
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  1. 1 0
      test/testjoystick.c

+ 1 - 0
test/testjoystick.c

@@ -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);