How to set up your DirectX Windows Store app to display a view
Before you start developing a DirectX Windows Store app, you must understand how to hook DirectX up to the windowing infrastructure provided by the Windows Runtime and exposed as the CoreApplicationView and CoreWindow types. Here we step you through the process of creating a CoreWindow object and connecting a DirectX swap chain to it.
Note This process described here can work for DirectX 9 and later. However, the provided code is specific to DirectX 11.1.
- C++ programming knowledge
- Familiarity with DirectX and DirectX terminology
- Some knowledge of the Windows Runtime framework
- A basic knowledge of COM/COM+
If you want to use DirectX in your game or graphics app, you must use native C++ for development, which means that you need to be familiar with references and basic memory management techniques. You should also have a basic grasp of design patterns such as the factory and singleton patterns. Also, if you're unfamiliar with DirectX graphics programming, take some time to read through the high-level DirectX 11 documentation to understand some of the terminology we use in this topic, such as view, render target, and swap chain.
The setup takes 3 steps:
- Creating and initializing an app view using the Windows Runtime, and obtaining a CoreWindow instance
- Setting up your event dispatch behaviors on that CoreWindow instance
- Connecting the DirectX swap chain to the CoreWindow instance and then performing a draw operation.
We want to get you quickly to a place where you can begin to output DirectX graphics and have basic events connected to that output.
Note Visual Studio 2012 provides a basic template for Windows Store apps using DirectX that implements some of this process for you.
Now that you created the basic flow of your DirectX app using C++ and the Windows Runtime APIs, you're ready to start connecting handlers to the events fired for PLM and basic user input.
Finally, it's time to do the hard part: bringing DirectX into the view provider you created for your Windows Store app built for Windows using DirectX with C++. You created the view provider and the factory that creates it, and you prepared the necessary events to handle PLM and basic input. Now, let's add the graphics resources that draw and manage the view, and which update in response to the events received by the app's CoreWindow.
This topic provides the complete code sample used in the tutorial How to set up your DirectX Windows Store app to display a view.
Build date: 3/14/2013