default

DirectInput vs. XInput

by Sabine Pölzlbauer

Hey guys out there, thanks for the valuable feedback so far! Some people also told us, they would like to see support not only for the Xbox controller but also for the general gamepad. So here are some facts about DirectInput and XInput from a developer’s point of view.
Microsoft introduced Xinput, forcing developers to use Xinput to get support for all Xbox controller features. The advantages are, that it has an easy setup and is simple to use. Nowadays some other game controllers (e.g. models from Logitech) support the Xinput interface as well, and others – which only support the direct input interface – can be simulated as XInput devices through an additional Emulation software like MotioninJoy or x360ce.
Direct Input on the other hand, can detect nearly any device (if there are drivers of course) and its capabilities. However, the API documentation is still not very informative. And it can be difficult to implement, due to the various supported devices with different axes and button layouts and therefore different data formats.

DirectInput
So at the moment, we are evaluating the situation (with the small number of different controllers that are available to us) and are implementing a technical sample. The PlayStation3 Controller for instance, could be supported per Direct Input, although I needed to install the MotioninJoy Driver before Input Data could be updated. I also tried to emulate it as XInput Device, where the capabilities could be read from the controller, but when trying to get some state data from it the “device was not connected.” Weird stuff! But at least it should work with Direct Input. 😉
We will see next time, which controllers we end up supporting and if it will be XInput only (like it is now), or a hybrid DirectInput – Xinput approach.