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. There is also a list of DirectX11 tutorials which might be useful once you have setup the DirectX12 Kit.

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 Blindfate.

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.

Adding the DirectX12 Kit

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

Understanding the Code so far

The code contains the setup of Direct3D but doesn’t draw anything as yet except for displaying a blue window.

Some helpful references to understand how the DirectX 3D pipeline works are here:

Setting up the Xbox

You can run your game on your Xbox to test it out and see what it looks like.

To do this, follow the steps here.

Note: you will have to reboot your Xbox out of development mode to play your games.

Next Steps

The next thing to do is to build our game bit by bit by adding more functionality (eg: user input on keyboard/mouse and games controller) and 2D / 3D graphics as we build by following the tutorials.