Skip to content
Chuck Walbourn edited this page May 7, 2021 · 95 revisions

GitHub Release Date

GitHub last commit

Install the latest with this link for VS 2017 / VS 2019. If you already have an older version installed, you can uninstall it from Visual Studio via Tools -> Extensions and Updates...

The last VS 2013 version of the VSIX was July 2017. The last VS 2015 version was October 2019.

Direct3D Game VS project templates

This repo contains Visual C++ project templates for game programming with DirectX. They are primarily intended for developer education, samples, and tutorials.

There are two versions of each template. The standard version is described in the Basic game loop tutorial lesson (DX11 or DX12). The DR version adds a DeviceResources (DX11 or DX12) abstraction to isolate the device and swapchain code into it's own helper class.

See this blog post and this one.

Visual Studio 2017

  • From the drop-down menu, select File and then New -> Project...
  • Select "Visual C++" on the left-hand tree-view.

New Project

Visual Studio 2019

  • From the drop-down menu, select File and then New -> Project... or on the startup dialog select Create a new project
  • Select "Games" on the project types filter. You can optionally type "Win32" or "UWP" in the search box as well.

New Project

Uninstalling

Extensions and Updates

You can also remove all instances from a Visual Studio Developer Command Prompt:

VSIXInstaller.exe /q /u:Direct3DUWPGame-1

d3d11game_win32, d3d12game_win32

Contains the Visual Studio 2017 and 2019 version of the Direct3D Win32 Game Visual Studio templates for Direct3D 11 and Direct3D 12.

Install this using VSIX\Direct3DUWPGame.vsix

The d3d12game_win32 template requires that the Windows Tools be installed as Direct3D 12 requires the Windows 10 SDK. See the Visual Studio Team blog for details.

d3d11game_uwp, d3d12game_uwp

Contains the Direct3D UWP Game Visual Studio template for VS 2017 and 2019 for the universal Windows platform for Windows 10 for Direct3D 11 and Direct3D 12.

Install this using VSIX\Direct3DUWPGame.vsix

d3d11game_win32_dr, d3d12game_win32_dr, d3d11game_uwp_dr, d3d12game_uwp_dr

DeviceResources variants of the templates.

d3d11game_uwp_cppwinrt, d3d12game_uwp_cppwinrt, d3d11game_uwp_cppwinrt_dr, d3d12game_uwp_cppwinrt_dr

Contains a Direct3D UWP Game Visual Studio template for VS 2017 and 2019 that makes use of the C++/WinRT language projections rather than C++/CX (/ZW).

 These templates make use of Microsoft::WRL::ComPtr rather than winrt::com_ptr so the code is more consistent between the various version. When using C++/WinRT and WRL together, you may have to use explicit winrt:: name resolution for the Windows and Windows::Foundation namespaces as WRL declares a few templates in those namespaces that you can't avoid when using WRL.

VSIX

VS Express editions do not support the extensibility features needed to install a VSIX package. Use VS Community or Pro+ editions instead.

The source for the Direct3DUWPGame.vsix is on GitHub. This requires VS 2017 with the .NET desktop development workload (Microsoft.VisualStudio.Workload.ManagedDesktop) and the Visual Studio extension development workload (Microsoft.VisualStudio.Workload.VisualStudioExtension).

Windows 10 SDK Usage

With VS 2017, when you create a project you will be prompted with a dialog to select which version of the Windows 10 SDK to use which will set the <WindowsTargetPlatformVersion> and <WindowsTargetPlatformMinVersion> values.

New Universal Windows Project

The Win32 VS templates use the same wizard, so will trigger the same dialog with the same title "New Universal Windows Project". DirectX 12 APIs are only in the Windows 10 SDK and the dialog lets you select the Target Version to build against. With VS 2017, the Windows 8.1 SDK is not installed by default, so these templates encourage using the Windows 10 SDK for all project types. Note that the Minimum Version value is not used by Win32 projects.

Release notes

  • The latest version of d3dx12.h requires the Windows 10 SDK Anniversary Update SDK 14393 or later.

  • When using C++/WinRT with the Windows 10 Fall Creators Update SDK (16299), use NuGet package 2017.10.13

  • When using C++/WinRT with the Windows 10 April 2018 Update SDK (17134) or later, use of the NuGet package is not required. See this blog post.

  • VS 2019 users wanting to make use of C++/WinRT should upgrade to the Windows 10 SDK (19041) or utilize the Microsoft.Windows.CppWinRT NuGet package.

  • VS 2017 users should apply the 15.5 update or later.

CMake projects

There are CMake files available for the Win32 templates here:

d3d11game_win32 CMakeLists.txt CMakeSettings.json
d3d11game_win32_dr CMakeLists.txt CMakeSettings.json
d3d12game_win32 CMakeLists.txt CMakeSettings.json
d3d12game_win32_dr CMakeLists.txt CMakeSettings.json

To create a new template instance without the use of Visual Studio, you can use the createcmake.ps1 PowerShell script.

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Windows 7 Service Pack 1

For Development

  • Visual Studio 2022
  • Visual Studio 2019
  • clang/LLVM v12 - v16
  • GCC/MinGW 12.2
  • CMake 3.20

Related Projects

DirectX Tool Kit for DirectX 11

DirectX Tool Kit for DirectX 12

DirectXMath

Clone this wiki locally