Tuesday, July 28, 2009

Can you use DirectX with C#?

Can u use the DirectX library in C#? If so is it the same functions?





- Cheers, Daniel

Can you use DirectX with C#?
The best option is to use Managed DirectX:


http://www.codeproject.com/cs/media/mdx_...





Before Managed DirectX, C# programmers would try COM Interop with the VB DirectX component.





I haven't tried myself (I'm a C/C++ programmer and haven't used DirectX but SDL which is a multiplatform library). But as I've been told by some friends (who are good at C#), C# / Managed Direct X is easier than learning to use C++/ DirectX.
Reply:You can, but not directly as far as I'm aware. You'd need to use DllImport/PInvoke to call DirectX, which is a native library rather than a .NET library.


No comments:

Post a Comment