How can I add a DirectX reference to my C# project in Visual Studio 2010? Thanks.
- Go to the solution explorer
- Click references
- Click add reference
- Click Browse
Browse to:
C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\
Select your directX package.
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.
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.
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.
© 2022 - 2024 — McMap. All rights reserved.