Is the GDK suitable for Enterprise .Net developers for Gamepad Input #27
Replies: 2 comments 9 replies
-
There are major differences between XInput and newer input APIs. Newer input APIs are built specifically to handle features of gamepads following the release of the Xbox One. For example, haptics such as impulse triggers featured in Xbox One controllers are not available for interop in XInput. The same can be said for gamepad extensions such as keyboards which I am sure newer input APIs facilitate such functionality. If you are not trying to target the Xbox One (and newer) or access the complete feature-set of controllers after the Xbox 360, which means you just want to poll for joystick and button input, then XInput will be more than sufficient for your use-cases. Anything more beyond that, you should be utilizing newer APIs Microsoft has to offer. I do want to mention that XInput isn't going anywhere, tons of modern games still utilize the API and it must exist for backwards compatibility but I cannot speak on behalf of Windows IoT. In regards to performance, you are not a user-group that is going to be taking advantage of such performance gains nor will they be noticeable for your current application, so it is negligeable. As far as newer APIs offering backwards compatibility, I heavily assume such is done by deferring calls to legacy APIs which include XInput and/or DirectInput. If you are wanting a new wrapper that is more intuitive and documented for XInput than what you have now I seriously recommend you check out a wrapper I made over XInput 1.4 for those targeting .NET. https://github.com/BlindEyeSoftworks/BlindEye.XInput The licensing is pretty basic but if you do not like it I give you complete and express permission to apply your own license to it and use it however you like. If you need a custom build for your specific use-case I am also more than happy to write such free of charge if it's within scope. If there is anymore info you need in regards to XInput and newer APIs feel free to ask. I have updated my answer to correct mistakes and provide more insight, I will also be updating my answer once I have more information on the APIs available for those shipping code for Windows IoT. EDIT: After digging around through some source code and documentation it is becoming pretty apparent that the GameInput API is its own entirely brand new API serving as a replacement for XInput. Nowhere was I able to find, nor prove, that calls are deferred to legacy APIs such as XInput either, meaning they would not be shipped with Windows IoT nor would said drivers and legacy APIs be compatible. I do not know if you are wanting to use these gamepads wirelessly but if so it is going to be even more trickier since the only hardware Microsoft lists as compatible would be a USB Xbox 360 controller, meaning dongles would not be an option without creating your own driver. As far as the Xbox One's Bluetooth capable controllers, I am not seeing any drivers available for such. My recommendation is that depending on the amount of machines needing to be controlled you can setup a single server which you will be able to connect controllers to and address them to specific machines. That server would then consume input and send them over the network to applicable IoT devices. Microsoft has created a similar sample here doing such for controlling robots. But to answer your main question, aside from rolling your own drivers and an API, the GameInput API would be very well suited for your application since it is expected to be used in the AAA game-industry. Unless someone else is able to chime in, or another option does exist which I have overlooked or missed, it seems as though said API is really your only option for IoT aside from utilizing a server. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late reply, have been waiting for a response but have not been given one as the server has been pretty quiet lately. In my above comment about the DLL being shipped with Windows as well for the DLL being able to be redistributed, it should be pretty straight-forward to create your own bindings for the public API. To do such you can just use the public documentation for function names, parameters, and data types. I am considering creating my own bindings like I did with XInput and releasing it but with the API still being relatively new I am going to wait as Microsoft may very well be working on one already. Each time I have tried to get ahead of Microsoft they have always released a similar project not even half-way through the course of my own which they also do a much better job at and have a much larger audience and reach. |
Beta Was this translation helpful? Give feedback.
-
Microsoft Documentation says (Under Getting Started):
And also says:
For enterprise developers using C# and the .Net toolings Is the GameInput APIs from the GDK suitable to use?
We are migrating from .Net Framework v 4.5.2 to .Net 6 since v 4.5.2 ran out of support a while ago.
In this upgrade process we were reviewing our APIs and was going to move from SharpDX.XInput which uses XInput v1.4 if available, falling back to v1.3, v9.1.0 sequentially if those are not available.
Our use-case is embedded machine remote control using the gamepads to remotely control unmanned machinery.
For .Net developers are we expecting there to be C# bindings available, and if not what's the modern recommended way for .Net applications to read input from controllers?
Beta Was this translation helpful? Give feedback.
All reactions