开发者

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

Closed. This question needs to be more focused. It is not currently accepting answers.
开发者_JAVA百科

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

Improve this question

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


  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.


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.


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜