Monday 24 October 2011

Setting Up Visual Studio 2010 for DirectX 9

Setting up VS210 for DirectX9 SDK

1.Grab the Direct X SDK : http://www.microsoft.com/download/en/details.aspx?id=6812
2.Install Visual Studio / Visual C++ (The express version is free!)

First things first, we need the correct tools for the job, and we need these tools to work with DirectX.

Visual Studio 2010 won’t work ‘out of the box’, a few things need to be changed. The SDK will be installed to your harddrive, mine is located at C:\Program Files\Microsoft DirectX SDK (June 2010). After installing VS2010 start up a new project, select project> Properties (ALT+F7), from here you’ll need to change the following:

Configuration Properties > VC++ Directories

Add the SDK Include folder to the Include Directories, proceed to do the same with the library directory as shown below. This can be done be simply selecting the drop down box and adding $(DXSDK_DIR)include & $(DXSDK_DIR)Lib respectively.



Linker > Input

Now we add the links to the static libraries for DirectX, add the d3d9.lib to your Addition Dependencies, d3dx9.lib I had to give an absolute reference to. You can set this for all projects by selecting “ALL CONFIGURATIONS” under the configuration drop down.



Configuration Properties > General

To avoid errors when passing multi-byte strings to a function which expects a unicode string set the character set – use multibyte character set.

No comments:

Post a Comment