How to add a DirectX reference in Visual Studio 20

2019-03-10 08:23发布

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

5条回答
聊天终结者
2楼-- · 2019-03-10 09:01
  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.

查看更多
混吃等死
3楼-- · 2019-03-10 09:08

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.

查看更多
干净又极端
4楼-- · 2019-03-10 09:16

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

查看更多
Bombasti
5楼-- · 2019-03-10 09:23

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.

查看更多
老娘就宠你
6楼-- · 2019-03-10 09:26

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.

查看更多
登录 后发表回答