Reputation: 1300
Is there any possibility to write Directx applications using C# ? How to install directx sdk for C# ? And what is the best (or most used) graphic library (framework) for C# ?
Upvotes: 5
Views: 7271
Reputation: 941545
You will find an installer included with the DirectX SDK, stored in the redist folder after you install the SDK on your machine. The SDK download is here. You only need it when you write native code or target .NET version 2 or earlier. .NET 3 and up already has a dependency on DirectX so its installer already covers your needs.
By far the most popular graphics libraries in .NET programming are System.Drawing and System.Windows.Media. They are wrappers for, respectively, GDI+ and a DirectX wrapper named Milcore. GDI+ uses software rendering and is thus highly compatible but not particularly fast. Milcore is used by WPF, it doesn't expose all of the DirectX capabilities, just the ones that a WPF program needs.
For game programming, the XNA framework is a common choice. Biggest reason to use it is its capability of running on multiple platforms, Windows, XBox and Phone, wrapping their respective low-level graphics libraries. DirectX on Windows has plenty of 3rd party wrappers for it, SlimDX is popular. There used to be one from Microsoft named "DirectX For Managed Code" that had wrappers in the Microsoft.DirectX namespace but they deprecated it. The last SDK that included it was February 2010. Not recommended, XNA replaced it.
Upvotes: 3
Reputation: 21521
I recently asked a question about SlimDX, which is a .NET Wrapper around DirectX. It's pretty up to date and more flexible than XNA (for instance, for scientific visualization apps). There are some tutorials although i'm told as its so similar to DirectX all you need to know is how to setup a device and then just use the DirectX equivalents from there.
Upvotes: 0