I'm currently implementing XInput and DirectInput support for our game, and I was wondering if XInput support belongs in SFML. If so, I wouldn't mind submitting a pull request when I'm done.
The current sf::Joystick uses the Windows Multimedia API, which works decently for most use cases. But having official support for XInput adds some useful things.
- It fixes the annoying bug of not being able to press L2 and R2 at the same time.
- It lets us easily detect and use a standardized controller configuration, instead of manually checking against a long list of different product ids and vendor ids.
- It allows us to send controller vibration events if SFML ever decides to add them.
Because XInput doesn't support certain controllers, it needs to be implemented alongside winmm or DirectInput for full gamepad support.
As a side note: my preliminary testing using DirectInput over winmm seems to indicate improved performance. It looks like winmm's joyGetPosEx(...) occasionally takes a lot of time to execute, but I need to do more testing to see what's going on.