Skip to content

Commit 197961d

Browse files
committed
Process SDL joypad events on startup
Make sure that SDL events are processed when the SDL joypad input driver is initialized, this will allow it to register the connected controllers when a game starts.
1 parent 42224bb commit 197961d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/sdl/joypad_sdl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ Error JoypadSDL::initialize() {
8888
SDL_AddGamepadMappingsFromIO(rw, 1);
8989
}
9090

91+
// Make sure that we handle already connected joypads when the driver is initialized.
92+
process_events();
93+
9194
print_verbose("SDL: Init OK!");
9295
return OK;
9396
}

0 commit comments

Comments
 (0)