Using DirectX with Visual Studio 2012
Asked Answered
E

3

11

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?"

Electromechanical answered 11/10, 2012 at 8:58 Comment(3)
Win8/VS2012 supports DirectX for C++ only (out of the box). If you want to use DirectX then C++ is the language to use (this is what Microsoft says). Anyway, what kind of App do you want to develop? Metro or Desktop for Win8? Compatible with Win7, too? What kind of .Net version do you want to use? This is important when choosing the technology/library to call DirectX from managed code (Metro has some restrictions and older .Net versions might not work together with your framework).Coenurus
... I would give SharoDX a try (API is very similar and your sample projects should be easy modify to use SharpDX). This is also a point for SlimDX but afaik SharpDX is faster.Coenurus
Now I don't really need to develop new app. I want to open these projects just to see how they work. If i start to develop new app I will probably use one of the wrappers.Electromechanical
C
9

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).

Coenurus answered 11/10, 2012 at 9:21 Comment(0)
R
3

Managed DirectX is obsolete and no longer maintained by Microsoft as it is being replaced by XNA. Last version to support Managed DirectX was this one (February 2010 release).

You can also give SlimDX a try :

SlimDX is a free open source framework that enables developers to easily build DirectX applications using .NET technologies such as C#, VB.NET, and IronPython. It is designed to be an efficient, simple, and lean wrapper that fully encompasses all of Microsoft's gaming and multimedia technologies and exposes them to managed code. All of the code is under the MIT/X11 license, and all content is under the Creative Commons Attribution-Share Alike license. Our latest release is March 2011, and can be found for users and developers on the Download page.

Rambort answered 11/10, 2012 at 9:9 Comment(2)
It is not sure if the code is actually Managed DirectX it could very well be XNA. This namespace (which is our only hint so far) also exists in XNA.Cacomistle
I thought it was managed Direct X because of this "I have some C# DirectX projects". But as you said, could be XNA too...unless he provides more details we cannot be certain.Rambort
C
1

You will probably need Microsoft XNA.

Cacomistle answered 11/10, 2012 at 9:10 Comment(5)
Can I open these old projects using XNA?Electromechanical
It depends on how old it is. The only hint you gave us is the Micorsoft.DirectX namespace. I believe this namespaces extists in the very old Managed DirectX as well as in XNA (which has quite a history now too). In case it is Managed DirectX you will have to convert it to XNA. If it already is XNA, you will have to convert it to the latest version of XNA (wich is propably less work).Cacomistle
I think it is Managed DirectX. Thanks for the answer.Electromechanical
It seems there is not much ongoning development for the XNA framework, too. XNA is a kind of base framework for you game (engine) whereas Managed DirectX was an aproach to make the unmanaged DirectX API directly available for .Net programmers => XNA has a different (and much simpler) API than (Managed) DirectX.Coenurus
I chcecked and XNA doesn't seem to support VS 2012.Electromechanical

© 2022 - 2024 — McMap. All rights reserved.