Using DirectX with Visual Studio 2012

Radek Wyroslak picture Radek Wyroslak · Oct 11, 2012 · Viewed 27.2k times · Source

I have some DirectX projects written in C# that I need to run via Visual Studio 2012 specifically.

All of these projects use the namespace called, "Microsoft.DirectX".

Microsoft Windows SDK installed completely and successfully on my Windows 8 computer, however this namespace is still unrecognised.

My question is, "How do I run and develop DirectX apps using a combination of C#, Visual Studio 2012 and MS Windows SDK?"

Answer

Beachwalker picture Beachwalker · Oct 11, 2012

I would recommend you to have a look at SharpDX. This is a thin managed access to DirectX and the API is very similar to the unmanaged version (SharpDX is automatically built from the unmanaged c++ header files). AFAIK this is currently the fastest managed aproach to use DirectX.

A very important thing might be the fact that you are able to develop Win8-Metro-Apps, too. AFAIK this is not possible/allowed with every other lib. I mentioned this because you wrote you want to develop on/for Win8 but you didn't said what kind of app. Metro-Apps has some more restrictions than Desktop-Apps for Win8.

Managed DirectX is out of date as already mentioned. But it seems that XNA is also not longer maintained since the release of the last version 4. So you are stuck if you want to use modern DX10 or DX11 because XNA uses DX9. An alternative here is the ANX framework. This project is currently in an early development stage but seems promising to me. ANX can use DirectX for rendering and uses SharpDX in this case. In contrast to XNA (which is strongly related to only DirectX9) SharpDX has the ability to use other renderers, too (e.g. OpenGL for Linux).