Add support for GameInput API on Windows#116055
Add support for GameInput API on Windows#116055Nintorch wants to merge 1 commit intogodotengine:masterfrom
Conversation
This won't work, since the official build system won't have them and users making custom builds won't have them. What can be done is making this optional (with Scons argument) and add download script for the headers, like we do for DX12 stuff (see install_d3d12_sdk_windows.py). |
|
This driver broke controller mapping for my DInput controller :( I will work on fixing this issue. |
|
I have fixed the mapping issue, but I think this PR would definitely conflict with #114642 , not sure if a controller that was opened with the GameInput driver can be used with DirectInput haptic effects. Maybe if we decide to use GameInput instead of DirectInput, I or someone else would have to create an SDL haptic driver for GameInput :( And also GameInput doesn't support retrieving input from devices if the application is not in focus, unless I can do something with it. |
|
Made a PR that may or may not be better than this approach in the short term: #116101 |
|
GameInput installation script is done and it makes the GCC Windows template compile! |
5f968fa to
cace447
Compare
cace447 to
2be7de7
Compare
Closes godotengine/godot-proposals#8620
This PR enables GameInput API backend for SDL on Windows. I know we have already discussed this API here, but in this PR we don't include GameInput headers/code, GameInput is downloaded with a script here, so it should be okay.
This PR also removes unused backends in Godot (RawInput, WGI). DirectInput is not replaced by GameInput in this PR since it's still used because of the haptics subsystem and #114642 , and XInput is used as a fallback if GameInput is not enabled in the build (if GameInput is enabled, XInput backend is not compiled).
With this PR the detection of my Xbox One controller has changed:
Note that the GUID ends with
6700, which means that this API is actually used. See the line 147 ofthirdparty\sdl\joystick\gdk\SDL_gameinputjoystick.c:TODO:
Input.get_joy_info()["xinput_index"]since XInput is no longer used#define HAVE_XINPUT_H 1get_deps_folder()indetect.pyis no longer neededTODO to fix regressions:
Create GameInput haptics backend for SDLI'm not knowledgeable enough in this area to do that :(TODO for separate PRs: