PDD_WAITFORVERTICALBLANK callback function (ddrawint.h)
The DdWaitForVerticalBlank callback function returns the vertical blank status of the device.
Syntax
PDD_WAITFORVERTICALBLANK PddWaitforverticalblank;
DWORD PddWaitforverticalblank(
PDD_WAITFORVERTICALBLANKDATA unnamedParam1
)
{...}
Parameters
unnamedParam1
Points to a DD_WAITFORVERTICALBLANKDATA structure that contains the information required to obtain the vertical blank status.
Return value
DdWaitForVerticalBlank returns one of the following callback codes:
Remarks
Depending on the value of the dwFlags member of the DD_WAITFORVERTICALBLANKDATA structure at lpWaitForVerticalBlank, the driver should do the following:
- If dwFlags is DDWAITVB_I_TESTVB, the driver should query the current vertical blanking status. The driver should set the bIsInVB member of DD_WAITFORVERTICALBLANKDATA to TRUE if the monitor is currently in a vertical blank; otherwise the driver should set bIsInVB to FALSE.
- If dwFlags is DDWAITVB_BLOCKBEGIN, the driver should block and wait until a vertical blank begins. If a vertical blank is in progress when the driver begins the block, the driver should wait until the next vertical blank begins before returning.
- If dwFlags is DDWAITVB_BLOCKEND, the driver should block and wait until a vertical blank ends.
DdWaitForVerticalBlank allows an application to synchronize itself with the vertical blanking interval (VBI).
There is also an issue with the WHQL Display Compatibility Tests (DCTs). One of the DCTs for power management powers down the monitor and then polls the vertical blank status, waiting for it to change. If the driver always reports the same vertical blank status when the monitor is powered down, then the test application will hang waiting for the result to change. This was fixed in the Permedia2 sample driver by returning alternating results while the monitor is powered down. That is, the first time the driver's DdWaitForVerticalBlank entry point is called with the DDWAIT_I_TESTVB flag (when the monitor is powered down), it returns FALSE, the next time it returns TRUE, next time FALSE, etc.
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | ddrawint.h (include Winddi.h) |