Visual C++/CLI and DirectX

Trying to get DirectX working with Visual C++/CLI in Visual C++ 2005 Express Edition.

I've installed the .NET 2.0 SDK and the latest DirectX SDK and have setup up the directories for DirectX in Visual C++ 2005 Express...

Tried looking at the DirectX Tutorials but everything in there is for C# as far as .NET goes. Any ideas how to get DirectX working with C++/CLI



Answer this question

Visual C++/CLI and DirectX

  • aaks

    If you are a beginner in working C++ with DirectX, you can start with the sample in the DirectX, and use the common file with DirectX samples,

    The common files provided a nice lightweight framework for DirectX development.



  • PaulLaudeman

     

    The sample DirectX Framework isn't written in C++/CLI as far as I can remember.

     

    C:\Program Files\Microsoft Visual Studio 8\DXSDK\Samples\C++\Direct3D\Tutorials\Tut01_CreateDevice

     When trying to build this sample in the SDK I get the following error:

    c:\program files\microsoft visual studio 8\dxsdk\include\d3d9.h(40) : fatal error C1083: Cannot open include file: 'objbase.h': No such file or directory


  • GROTH

    The managed DirectX framework is written in .NET, therefore can be used in any .NET language (for more information, google on ".NET interop").

    Anyway, the sample tutorial you pointed out is for unmanaged DirectX (ie. DirectX programming without using .NET). To compile this sample, you need to download and install the Platform SDK.

    AFAIK, the DX SDK only provides one managed DirectX sample which is written in C++ (and even then it's managed C++, old syntax). That's the Scripting tutorial (Samples/Managed/Direct3D/Scripting).

    To work with managed DirectX in C++/CLI, you're going to have to translate the C# samples into C++/CLI (it is at this point, most people give up and just do everything in C#). For help with translating C# -> C++/CLI, I suggest reading nish's Codeproject series on C++/CLI (what I like to call "The C++/CLI Bible").



  • Visual C++/CLI and DirectX