libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.79k stars 1.82k forks source link

What is this API? #5545

Closed Sawtaytoes closed 2 years ago

Sawtaytoes commented 2 years ago
  1. Just so I understand, is this the library used by Steam Input?
  2. Is it an abstraction layer on top of X-Input, D-Input, and the like or does it work at an even lower level?
  3. How does this library differentiate between an Xbox controller's Left and Right triggers as they share the same axis in DInput and RawInput?
  4. I read somewhere that SDL2 doesn't work with rumble on Xbox controllers when disabling X-Input (which only supports up to 4 controllers). Is that the case anymore?
  5. Does this library support trigger rumble on the Xbox One controllers?
  6. If you want to support more than 4 controllers, is there anything special that needs to be done?
slouken commented 2 years ago

This is probably better asked on the SDL forums , but here you go:

  1. Just so I understand, is this the library used by Steam Input?

Yes.

  1. Is it an abstraction layer on top of X-Input, D-Input, and the like or does it work at an even lower level?

Yes, it's an abstraction over the normal platform controller APIs.

  1. How does this library differentiate between an Xbox controller's Left and Right triggers as they share the same axis in DInput and RawInput?

It tries to correlate raw devices with XInput and WGI devices and uses XInput or WGI for trigger data when available.

  1. I read somewhere that SDL2 doesn't work with rumble on Xbox controllers when disabling X-Input (which only supports up to 4 controllers). Is that the case anymore?

No, if SDL is able to correlate with WGI devices, it's able to rumble using that API.

  1. Does this library support trigger rumble on the Xbox One controllers?

Yes, if SDL is able to correlate with WGI devices, it's able to rumble triggers using that API.

  1. If you want to support more than 4 controllers, is there anything special that needs to be done?

No, the default build of SDL has support for more than 4 controllers.