mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fixed hotplug with more than one device in testjoystick program.
This commit is contained in:
parent
0a3f9d0cfb
commit
b515b34dbb
@ -321,6 +321,7 @@ main(int argc, char *argv[])
|
|||||||
|| (event.type == SDL_MOUSEBUTTONDOWN)) {
|
|| (event.type == SDL_MOUSEBUTTONDOWN)) {
|
||||||
keepGoing = SDL_FALSE;
|
keepGoing = SDL_FALSE;
|
||||||
} else if (event.type == SDL_JOYDEVICEADDED) {
|
} else if (event.type == SDL_JOYDEVICEADDED) {
|
||||||
|
device = event.jdevice.which;
|
||||||
joystick = SDL_JoystickOpen(device);
|
joystick = SDL_JoystickOpen(device);
|
||||||
if (joystick != NULL) {
|
if (joystick != NULL) {
|
||||||
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);
|
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);
|
||||||
|
Loading…
Reference in New Issue
Block a user