Graphics Reference
In-Depth Information
Format = Format.R8G8B8A8_UNorm,
Stereo = false,
SampleDescription = new SampleDescription(1, 0),
Usage = Usage.BackBuffer | Usage.RenderTargetOutput,
BufferCount = 1,
Scaling = Scaling.Stretch,
SwapEffect = SwapEffect.Discard,
};
swapChain = new SwapChain1(factory,
device,
form.Handle,
ref desc1,
new SwapChainFullScreenDescription()
{
RefreshRate = new Rational(60, 1),
Scaling = DisplayModeScaling.Centered,
Windowed = true
},
// Restrict output to specific Output (monitor)
null);
}
To retrieve the Direct3D 11.2 swap chain, create the swap chain as
done here and then use a call to swapChain.QueryInterfaceO
rNull<SwapChain2>();
6.
Finally we will change the swapChain.Present call from within the render loop of
the previous recipe to:
// Present the frame
swapChain.Present(0, PresentFlags.None, new
PresentParameters());
7.
Run the project ( F5 ). The result should be identical to the previous recipe.
How it works…
Our first change to the previous code is the addition of a new directive using an alias directive
for SharpDX.Direct3D11.Device1 . We keep the SharpDX.Direct3D11.Device alias
because we first create a regular device and then query it for the 11.1 implementation.
 
Search WWH ::




Custom Search