Fix DirectInput controllers on game startup
Now SDL and DirectInput don't complain when a game starts with a DirectInput controller already connected. Fixes "JoypadSDL::process_events: Error opening gamepad at index 1: IDirectInputDevice8::SetCooperativeLevel() DirectX error 0x80070006"
This commit is contained in:
parent
7cc3f374a5
commit
dd2e1b104b
3 changed files with 18 additions and 18 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue