3D Win UWP App

This page goes through on how to build the 3D game for Windows 10 – it will be a Windows UWP (Universal Windows Platform) App. The UWP App means that your game will run on any Windows device, whether it’s a PC, tablet and Xbox. It will also be available to be put on the Windows Store.

I am using Windows DirectX 12 which is an API that allows you to build a 3D game.

To build this app, I am using the following resources:

With Visual Studio Community, you have to download the Windows Universal tools for C++

Setting up the DirectX12 Kit

To setup the DirectX12 Kit, read the following documentation. Read the Getting Started guide, then go through the tutorials.

Game Loop

The first tutorial and the second tutorial takes you through the Game Loop using win32 and winUWP respectively. On this page, I used the second tutorial as I wanted to use Windows UWP with Device Resources (DR).

You download and install the VSIX file, then create a new project.

Select the project Direct3D12 UWP Game DR (C++/WinRT) as below.

Then save it to a folder on your computer. I called my game Star Invaders.

When you run it by pressing the green play button (I changed it to 64 bit)

it will look like below:

The tutorial explains what is going on.

The following classes are created:

  • Game – the main game class for our game.
  • IDeviceNotify – checks if the Direct3D device is created or lost
  • DeviceResources – this class creates the Direct3D device and has the code to display graphics to the screen
  • StepTimer – the timer for the game to keep the game running smoothly
  • ViewProvider – creates the Window app using WinRT. You might be more familiar with win32 code to create a Windows app, but Microsoft has updated its C++ to use WinRT for the future.

Adding the DirectX12 Kit

The third tutorial runs through adding the DirectX12 Kit to our game. Read the instructions carefully on doing this.