Game Development Reference
In-Depth Information
FormObject.Height,new Rational(60,
1),Format.R8G8B8A8_UNorm),
SampleDescription = new
SampleDescription(1, 0),
Flags = SwapChainFlags.AllowModeSwitch,
SwapEffect = SwapEffect.Discard
};
// Create the SwapChain
SlimDX.Direct3D11.Device.CreateWithSwapChain(
DriverType.Hardware,
DeviceCreationFlags.Debug,
new FeatureLevel[] {
FeatureLevel.Level_11_0 },
swapChainDesc,
out m_Device,
out m_SwapChain);
// create a view of our render target,
which is the backbuffer of the swap chain we
just created
using (var resource
=SlimDX.Direct3D11.Resource.FromSwapChain<Texture2D>(m_SwapChain,
0))
{
m_RenderTargetView = new
RenderTargetView(m_Device,resource);
}
// Get the device context and store it in
our m_DeviceContext member variable.
m_DeviceContext = m_Device.ImmediateContext;
// Setting a viewport is required if you
want to actually see anything
Search WWH ::




Custom Search