DirectX inputs in C#? (in Unity?) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
+ 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