#660

Feature Request: Use SDL3 as the backend for the GameInput shim (DualSense & gyro support)

OpenKabosuneopened 12h ago

Hi! Since Leonida has to shim/reimplement Xbox's GameInput API for PC, would you consider backing the GameInput layer with SDL3?

Why SDL3:

  • Native multi-controller support: DualSense, DualShock 4, Switch Pro, Xbox, Steam Deck, etc. work out of the box without needing DS4Windows or Steam Input.
  • Sensor & DualSense features: SDL3 exposes SDL_SENSOR_GYRO / SDL_SENSOR_ACCEL (plus rumble/LEDs/touchpad) through a single unified API, whereas Windows GameInput doesn't expose gyro on most third-party controllers.

Regarding gyro aiming: I know simply swapping the GameInput backend to SDL3 won't automatically give the game gyro (since the Xbox binary itself doesn't read GameInputMotionState for aiming), so this would be a two-part thing:

  1. Back the GameInput shim with SDL3 for broad controller support and sensor access.
  2. Down the line (once camera/mouse look hooks are in place), optionally feed SDL_SENSOR_GYRO deltas directly into the camera/aiming input (or mouse look) for true mouse-like gyro aiming—with a simple toggle/sensitivity config (e.g., gyro active on ADS/L2).

Thanks for all the work on the project!

Activity

1
ismailchaka112h ago

Looked into picking this up. Two things need deciding before code:

  1. There is no GameInput shim yet. Nothing in runtime/, docs/ or tools/ mentions GameInput, and nothing measured so far shows which interface version (if any) the executable asks for. Per AGENTS.md ("before you guess, look"), the first step is checking the game's imports (GameInput.dll / GameInputCreate, and the IID it requests) on someone's own copy, so the shim matches the real ABI.
  2. SDL3 would be a new vendored dependency. The runtime vendors only third_party/xtaskqueue today. SDL3 is zlib-licensed, but it's much larger; is it acceptable in third_party/ (or as an optional CMake dependency)?

Proposed order if SDL3 is OK:

  • a plain GameInput shim for one standard gamepad (buttons, sticks, triggers, rumble), on the interface version the imports show;
  • SDL3 as its backend (DualSense/DS4/Switch Pro without Steam Input);
  • gyro into camera/aim later, as the request says, once there is a look-input hook.

Happy to take the first two once there's a yes on SDL3 and someone with the game can confirm the import. AI-assisted.