mirror of
https://github.com/yawut/SDL.git
synced 2026-04-25 07:52:57 -05:00
Fixed hotplug with more than one device in testjoystick program.
This commit is contained in:
parent
7d96beee5e
commit
af39fc10d3
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user