Game Development Reference
In-Depth Information
return _idCounter;
}
This method is fairly simple. It accepts a unique swap chain identifier, finds the
associated object, and releases the swap chain object from the manager.
public void DestroySwapChain(int id)
{
SwapChainInstance instance = FindSwapChainInstance(id);
if (instance != null)
{
DestroySwapChain(instance.SwapChain);
instance.SwapChain = null;
_swapChainList.Remove(instance);
}
}
This method works very similarly to DestroySwapChain() , except instead of destroy-
ing the swap chain, it simply resets it. A specific use for this method is after a child
window has been resized and the swap chain(s) must be reset to reflect the new
render target region(s).
public void ResetSwapChain(int id)
{
SwapChainInstance instance = FindSwapChainInstance(id);
ResetSwapChain(instance);
}
This method accepts a unique identifier, locates the referenced swap chain object
in the manager, and returns a reference to it.
private SwapChainInstance FindSwapChainInstance(int id)
{
foreach (SwapChainInstance instance in _swapChainList)
{
if (instance.Id.Equals(id))
return instance;
}
return null;
}
Search Nedrilad ::




Custom Search