Graphics Reference
In-Depth Information
Finally, the
SharpDX.Toolkit.dll
assemblies provide a high-level game API for Direct3D
11 much like XNA 4.0 does for Direct3D 9. These assemblies hide away a lot of the low-level
Direct3D interaction and provide a number of compilation tools and convenience functions to
streamline including shaders and other game content in your project. The framework is worth
taking a look at for high-level operations, but as we will tend to be working with the low-level
API, it is generally not suitable for our purposes here.
The SharpDX package provides binaries for various platforms. We have used the DirectX 11.1
.NET 4.0 or the DirectX 11.2 .NET 4.0 build here and will use the WinRT build in
Chapter 11
,
Integrating Direct3D with XAML and Windows 8.1
. SharpDX also provides assemblies and
classes for Direct3D 11, Direct3D 10, and Direct3D 9.
See also
F
We will see how to gain access to the Direct3D 11.1/11.2 device and swap chain
in the next recipe,
Initializing a Direct3D 11.1/11.2 device and swap chain
.
F
In
Chapter 2
,
Rendering with Direct3D
, we will cover more detail about rendering,
and focus on resource creation, the rendering loop, and simple shaders.
F
Chapter 11
,
Integrating Direct3D with XAML and Windows 8.1
, shows how to build
a Windows Store app for Windows 8.1.
F
The Microsoft Developer Network (MSDN) provides a great deal of useful
information. The Direct3D launch page can be found at
http://msdn.microsoft.
com/en-us/library/windows/desktop/hh309466(v=vs.85).aspx
.
Initializing a Direct3D 11.1/11.2 device and
swap chain
We now know how to create our device and swap chain, however, we do not yet have
access to some of the features available in Direct3D 11.1 or 11.2 as we are only creating
Direct3D 11 references.
In this recipe we will modify the previous example so that we are instead creating
SharpDX.Direct3D11.Device1
and
SharpDX.DXGI.SwapChain1
(natively these are
ID3D11Device1
and
IDXGISwapChain1
, respectively) to access Direct3D 11.1 features,
and
SharpDX.Direct3D11.Device2
, and
SharpDX.DXGI.SwapChain2
(natively these
are
ID3D11Device2
and
IDXGISwapChain2
, respectively) to access the features of
Direct3D 11.2.
Device1
allows, among others, the creation of blend states that utilize logical operations
and access to
DeviceContext1
to access larger constant buffers in shaders than would
normally be possible.