Game Development Reference
In-Depth Information
}
public Control RenderTarget
{
get { return _renderTarget; }
set { _renderTarget = value; }
}
public SwapChainInstance(int id,
SwapChain swapChain,
PresentParameters presentParameters)
{
this._id = id;
this._swapChain = swapChain;
this._presentParameters = presentParameters;
}
}
As discussed earlier, there is an issue regarding the implicit swap chain of the
device. Perhaps the best way to avoid any problems is to simply ignore the implic-
it swap chain. This approach is used for the solution, although an alternative
approach had been tried with minor success prior to settling on this one.
The next class encompasses the bulk of the swap chain framework. The manager
class is responsible for the construction, usage, and destruction of swap chains, and
is also accountable for handling the association of a swap chain with a child window.
public sealed class SwapChainManager
{
private List<SwapChainInstance> _swapChainList = new List<SwapChainInstance>();
private SwapChainInstance _activeSwapChain;
private int _idCounter;
private Device _device;
private bool _ready;
private Mesh _teapotMesh;
private Mesh _sphereMesh;
public Device Device
{
get { return _device; }
}
public bool Ready
{
Search Nedrilad ::




Custom Search