This project is now hosted on GitHub
. This site is being maintained for now, but please move to using GitHub
particularly as the CodePlex copy of the tutorials are a little dated.
After creating a new project in the
The basic game loop
, the next step is to add the DirectX Tool Kit
to the project so we can make use of it in our code.
NuGet package manager
The easiest way to achieve this is to use the NuGet package manager
built into VS 2013.
- From the drop-down menu, select Project / Manage NuGet Packages...
- Select "Online/All" in the left-hand tree view
- In the text search field on the top-right type "DirectX Tool Kit" and hit enter to search for the packages
- Select the package with the id directxtk_desktop_2013
- Select "Install"
- Select "Close"
You can check for updates to the NuGet package by selecting "Updates/All" in the left-hand tree view. If there are updates, select the "DirectX Tool Kit" package, and click on "Update".
Another option rather than using NuGet is to use Visual Studio's project-to-project references. This approach is a little more setup, but it does ensure that you are building the full DirectX Tool Kit library as part of your solution, and allows you to
make changes directly to the tool kit if desired as well.
- Extract the DirectXTK.zip file into a directory relative to the new project you created. For this tutorial, we will assume the "DirectXTK" folder is in the same folder as your new project's Visual Studio Solution (.sln) file.
- Right-click on your solution in the Solution Explorer, and select Add /
- Browse into the "DirectXTK" folder and select "DirectXTK_Desktop_2013.vcxproj", click "Open"
- If Visual Studio presents a "Security Warning", select "OK". Optional: Uncheck "Ask me for every project in this solution" first.
- Right-click on your project in the Solution Explorer, and select Add /
- Select "Add New Reference..."
- Check "DirectXTK_Desktop_2013" and select "OK"
- Click on "Configuration Properties" in the left-hand tree view, then
C/C++ / General
- Select "All Configurations" and "All Platforms"
- Edit Additional Include Directories to the relative path to the "DirectXTK\Inc" folder. With our original assumption, you can use "$(SolutionDir)\DirectXTK\Inc".
- Select "OK"
For more information see
under Adding to a VS solution
Adding the headers
Now that we have the DirectX Tool Kit
usable in your project, the next step is to include the library headers into your project.
General advice for C++ projects is that you should only add the headers you actually use to your project, but to simplify the tutorial we will go ahead and add them all to your new project's
// Header for standard system include files.
Then finish off the setup by adding a C++ namespace using statement to your Game.cpp
file to make it a bit easier to use the SimpleMath types:
Sprites and textures
// Game.cpp -
using namespace DirectX;
using namespace DirectX::SimpleMath;
Game controller input
Using the SimpleMath library
Adding the DirectX Tool Kit for Audio