CanvasSwapChainWaitForVerticalBlank Method |
Namespace: Microsoft.Graphics.Canvas
public void WaitForVerticalBlank()
A vertical blank on a display, such as a monitor, occurs when the monitor is ready to begin drawing the next frame. For many monitors this occurs every 1/60th of a second, or 60Hz. Because new imagery on a display cannot be seen with any finer granularity than that, many apps threshold their game loop to not iterate any more frequently than vertical blank. An app's render thread may be able to save CPU usage by waiting until the next vertical blank to process information or redraw, rather than busy-spin for the correct time interval.
WaitForVerticalBlank is designed to be a synchronous call in order to be as efficient as possible. It blocks until the next vertical blank occurs.
If your app has multiple swap chains which will render on the same thread, and their behavior should be synchronized to vertical blank, only call WaitForVerticalBlank on one of the swap chains. The choice of which swap chain is arbitrary.
If the device you used to create the swap chain had the ForceSoftwareRenderer option set to true, or D3D_DRIVER_TYPE_WARP (in the case of Direct3D interop), the display cannot be accessed to wait on vertical blank. In that case, this method will relinquish the remainder of this thread's time slice to any other thread that is ready to run.