Selaa lähdekoodia

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.
Nintorch 2 kuukautta sitten
vanhempi
commit
197961ddc9
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      drivers/sdl/joypad_sdl.cpp

+ 3 - 0
drivers/sdl/joypad_sdl.cpp

@@ -88,6 +88,9 @@ Error JoypadSDL::initialize() {
 		SDL_AddGamepadMappingsFromIO(rw, 1);
 	}
 
+	// Make sure that we handle already connected joypads when the driver is initialized.
+	process_events();
+
 	print_verbose("SDL: Init OK!");
 	return OK;
 }