Game Development Reference
In-Depth Information
get { return _ready; }
}
public Mesh TeapotMesh
{
get { return _teapotMesh; }
}
public Mesh SphereMesh
{
get { return _sphereMesh; }
}
The following method is a critical part of the manager. It is responsible for build-
ing present parameters and creating a swap chain object that becomes referenced
by the manager with a unique identifier.
public int CreateSwapChain(Control renderTarget)
{
_idCounter++;
PresentParameters presentParams = new PresentParameters();
presentParams.AutoDepthStencilFormat = DepthFormat.D16;
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.EnableAutoDepthStencil = true;
presentParams.DeviceWindow = renderTarget;
presentParams.BackBufferWidth = renderTarget.Width;
presentParams.BackBufferHeight = renderTarget.Height;
if (renderTarget != null && _device != null)
{
SwapChain swapChain = new SwapChain(_device, presentParams);
SwapChainInstance instance = new SwapChainInstance(_idCounter,
swapChain,
presentParams);
instance.RenderTarget = renderTarget;
_swapChainList.Add(instance);
}
Search Nedrilad ::




Custom Search