0

DirectX inputs in C#? (in Unity?)

In Unity, or in "plain" C# (without it) I would like to map the input devices (gamepads). By hand from null, it would be a pain, I know, but DirectX handles input as well. What method do you suggest to handle inputs with DX (what library)? If Unity is given, should I use an external library for it, or DirectX can be used to avoid Unity inputs directly from Unity engine? (I've met SlimDX, but don't know if there are other relevant libraries better for that purpose.)

24th Jun 2017, 2:25 PM
Magyar Dávid
Magyar Dávid - avatar
4 Réponses
+ 1
Sorry, you are very right I should not have done that. Here’s something I found. The rumor has been around for a while …. It is now official, XNA is dead, or soon will be, since it is to be retired on April 2014. Lots of regrets from indie game developers could be found on the net. “Those were the days !” … at least when it came to the high-level API in C# and its Content Pipeline system. But do not worry, some solutions exist 😉 In our case, I chose to port to SharpDX, more specifically SharpDX toolkit, the high-level API based on DirectX 11. This API is yet not fully mature, but it is already efficient and has a very responsive community. Last time I had a problem, the author Alexandre Mutel provided me with a patch within the day. It really is similar to XNA, but has the power of DirectX11, and is compatible with Windows 8 (including mobile version) and Visual Studio 2012. Of course it also works with older GPU classes : our new project WTW targets DirectX 10 cards. The main drawback of SharpDX toolkit is the absence of the Content Pipeline. I solved the problem by using a custom MSBuild project and homemade MSBuild tasks to process the contents. I also use the lib Assimp for 3D models, and the effect compiler of SharpDX to process shaders. You can directly use DDS for the textures. As for the sounds, I don’t know, I haven’t searched yet: p
27th Jun 2017, 7:08 PM
Square Weber Interactive
Square Weber Interactive - avatar
0
@KryoTek Studios: I appreciate your willing to help, but copying and posting the SharpDX sample really helps me nothing. Do you have experience with SharpDX, or just googled my question? By "method" a meant the way to handle input, not code. So, is SharpDX a good solution? Why should I choose it? Does this sample work in Unity or only with SharpDX? ( To reference the sample could have been a better way: https://github.com/sharpdx/SharpDX-Samples/blob/master/Desktop/DirectInput/JoystickApp/Program.cs ) However copyright is granted, you should at least sign the source next time, it seems as your code, while it is not.
25th Jun 2017, 7:51 AM
Magyar Dávid
Magyar Dávid - avatar
0
Hope this helps
27th Jun 2017, 7:09 PM
Square Weber Interactive
Square Weber Interactive - avatar
27th Jun 2017, 7:10 PM
Square Weber Interactive
Square Weber Interactive - avatar