How to add a DirectX reference in Visual Studio 2010 [closed]
Asked Answered
G

5

7

How can I add a DirectX reference to my C# project in Visual Studio 2010? Thanks.

Goodard answered 11/12, 2010 at 0:33 Comment(1)
Post on GameDev with more / up to date information: Can I use DirectX with C#?Sydneysydnor
C
14
  1. Go to the solution explorer
  2. Click references
  3. Click add reference
  4. Click Browse
  5. Browse to:

    C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\

  6. Select your directX package.

Centrepiece answered 20/6, 2012 at 14:33 Comment(1)
Managed DirectX has been abandoned/deprecated for some time now.Schenk
P
5

There is one way i have find. First you need to install DXSDK (i have June2010 and SDK for Windows 7). Go to "Add reference" dialog press "Browse" , go to somthing like this C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0 or C:\Windows\Microsoft.NET\Managed DirectX\v9.02.2904 then choose proper dll for example - Microsoft.DirectX.dll. So you can add "using Microsoft.DirectX" directive to your project. All done.

Powell answered 15/11, 2013 at 10:42 Comment(0)
C
4

DirectX is for unmanaged code - C++. To use it from C# you need to find a wrapper library for it. The two best right now are SlimDX and SharpDX. Grab the binaries from the sites and just add a reference to them.

Complain answered 11/12, 2010 at 0:39 Comment(3)
but i do it on visual studio 2008 ?!?!?Goodard
Sorry but I can't understand that...Complain
There are managed directx 9.0 libraries for c# from Microsoft as wellPaprika
P
0

You can also use the Windows API code pack from http://code.msdn.microsoft.com/WindowsAPICodePack. Then, look at the article http://blogs.msdn.com/b/msaleh/archive/2009/08/25/introducing-directx-features-of-windows-api-code-pack.aspx, and you should be started. (the article talks about VS2008, but it works on VS2010 too)

Good luck....

Paginate answered 11/12, 2010 at 1:0 Comment(0)
M
0

We use managed directx too. You should download DirectX Software Development Kit: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c72d9f1e-53f3-4747-8490-6801d8e8b4ef

Dlls for using DirectX in managed code have included into it.

Maurizia answered 11/12, 2010 at 6:5 Comment(2)
i install DirectX SDK ! and i can do this on vs 2008 but in vs 2010 there isn`t any item for DirectX !Goodard
You'll probably have to change the target framework to 2.0.Complain

© 2022 - 2024 — McMap. All rights reserved.