Merge pull request #109819 from Nintorch/fix-get-connected-joypads

Fix DirectInput controllers on game startup
This commit is contained in:
Thaddeus Crews
2025-08-25 09:54:17 -05:00
3 changed files with 18 additions and 18 deletions

View File

@ -7188,10 +7188,8 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
}
#ifdef SDL_ENABLED
joypad_sdl = memnew(JoypadSDL());
if (joypad_sdl->initialize() == OK) {
joypad_sdl->setup_sdl_helper_window(windows[MAIN_WINDOW_ID].hWnd);
} else {
joypad_sdl = memnew(JoypadSDL(windows[MAIN_WINDOW_ID].hWnd));
if (joypad_sdl->initialize() != OK) {
ERR_PRINT("Couldn't initialize SDL joypad input driver.");
memdelete(joypad_sdl);
joypad_sdl = nullptr;