Walkthrough: Port a simple Direct3D 9 app to DirectX 11.1 and the Windows Store

This topic has not yet been rated - Rate this topic

[This documentation is preliminary and is subject to change.]

This porting exercise shows how to bring a simple rendering framework from Direct3D 9 to Direct3D 11.1 and the Windows Store. This walkthrough includes the following steps:

In this section

TopicDescription

Part 1: Initialize Direct3D

How to get handles to the Direct3D device and the device context, and how to use DXGI to set up a swap chain.

Part 2: Convert the rendering framework

How to port geometry buffers, compile and load HLSL shader programs, and implement the rendering chain in Direct3D 11.1.

Part 3: Port the game loop

How to build an IFrameworkView to control a full-screen CoreWindow and run the game loop.

 

This topic walks two code paths that perform the same basic graphics task: display a rotating vertex-shaded cube. In both cases, the code covers the following process:

  1. Creating a Direct3D device and a swap chain.
  2. Creating a vertex buffer, and an index buffer, to represent a colorful cube mesh.
  3. Creating a vertex shader that transforms vertices to screen space, a pixel shader that blends color values, compiling the shaders, and loading the shaders as Direct3D resources.
  4. Implementing the rendering chain and presenting the drawn cube to the screen.
  5. Creating a window, starting a main loop, and taking care of window message processing.

Upon completing this walkthrough, you should be familiar with the following basic differences between Direct3D 9 and Direct3D 11.1:

  • The separation of device, device context, and graphics infrastructure.
  • The process of compiling shaders, and loading shader bytecode at runtime.
  • How to configure per-vertex data for the Input Assembler (IA) stage.
  • How to use an IFrameworkView to create a CoreWindow view.

Prerequisites

You should Prepare your dev environment for Windows Store DirectX game development. You don't need a template yet, but you'll need Visual Studio 2012 to load the code samples for this walkthrough

Download the Simple Direct3D 9 to DirectX 11.1 Windows Store porting sample. This sample includes the Direct3D 9 and Windows Store code paths shown in this walkthrough.

Visit Porting concepts and considerations to gain a better understanding of the DirectX 11.1 and Windows Store programming concepts shown in this walkthrough.

Related topics

Direct3D
Developing for different Direct3D feature levels
Writing HLSL Shaders in Direct3D 9
Create a new DirectX 11.1 project for Windows Store
Windows Store
Microsoft::WRL::ComPtr
Handle to Object Operator (^)

 

 

Build date: 3/22/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.