Graphics Reference
In-Depth Information
Preparing the swap chain for a Windows
Store app
In this recipe, we will look at the code necessary to create a new class inheriting from
the
D3DApplicationBase
class from
Chapter 2
,
Rendering with Direct3D
, that will
prepare a swap chain description for use in a Windows Store app for Windows 8.1.
We will also prepare a Windows Store compatible version of the
Common
library we
have used throughout this topic.
Getting ready
To target Windows 8.1, we need to use Visual Studio 2013.
Before commencing, we will need to have the SharpDX 11.2 WinRT binaries at hand. At the
time of writing this topic, this requires using the latest development package (2.5.1) found on
the SharpDX webpage
http://sharpdx.org/news/
. For the remainder of the chapter,
we will assume that these can be located upon navigating to
.\External\Bin\
DirectX11_2-Signed-winrt
under the solution location.
There exists a SharpDX NuGet package; however, at the time of
writing this topic, the package has not yet been updated for Windows
8.1 and Direct3D 11.2.
How to do it…
We'll begin by creating a new class library and reusing a majority of the
Common
project
used throughout the topic so far, then we will create a new class
D3DApplicationWinRT
inheriting from
D3DApplicationBase
to be used as a starting point for our Windows Store
app's render targets.
1.
Within Visual Studio, create a new Class Library (Windows Store apps)
called
Common.WinRT
.