Skip to content

Latest commit

 

History

History
91 lines (73 loc) · 4.72 KB

nc-ddrawint-pdd_waitforverticalblank.md

File metadata and controls

91 lines (73 loc) · 4.72 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NC:ddrawint.PDD_WAITFORVERTICALBLANK
PDD_WAITFORVERTICALBLANK (ddrawint.h)
The DdWaitForVerticalBlank callback function returns the vertical blank status of the device.
DdWaitForVerticalBlank
DdWaitForVerticalBlank callback function [Display Devices]
PDD_WAITFORVERTICALBLANK
PDD_WAITFORVERTICALBLANK callback
ddfncs_ed0f04a7-78e9-4ecc-80a6-95127dc28aed.xml
ddrawint/DdWaitForVerticalBlank
display.ddwaitforverticalblank
display\ddwaitforverticalblank.htm
display
0eeeed70-bfda-45c0-8709-29e97ab0c5a9
12/05/2018
DdWaitForVerticalBlank, DdWaitForVerticalBlank callback function [Display Devices], PDD_WAITFORVERTICALBLANK, PDD_WAITFORVERTICALBLANK callback, ddfncs_ed0f04a7-78e9-4ecc-80a6-95127dc28aed.xml, ddrawint/DdWaitForVerticalBlank, display.ddwaitforverticalblank
ddrawint.h
Winddi.h
Desktop
Windows
19H1
PDD_WAITFORVERTICALBLANK
ddrawint/PDD_WAITFORVERTICALBLANK
c++
APIRef
kbSyntax
UserDefined
ddrawint.h
DdWaitForVerticalBlank

-description

The DdWaitForVerticalBlank callback function returns the vertical blank status of the device.

-parameters

-param unnamedParam1

Points to a DD_WAITFORVERTICALBLANKDATA structure that contains the information required to obtain the vertical blank status.

-returns

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.
When the driver successfully handles the action specified in dwFlags, it should set DD_OK in the ddRVal member of DD_WAITFORVERTICALBLANKDATA and return DDHAL_DRIVER_HANDLED. The driver should return DDHAL_DRIVER_NOTHANDLED for those flags that it is incapable of handling.

DdWaitForVerticalBlank allows an application to synchronize itself with the vertical blanking interval (VBI).

Note  DdWaitForVerticalBlank should never enter a polling loop if the monitor power state will cause the driver to hang. For example, during a monitor power-down, an application might call WaitForVerticalBlank. The DirectDraw runtime calls the display driver's DdWaitForVerticalBlank entry point, which waits for the status to change. If the monitor is powered down, this value will never change--unless the driver writer prepares for this scenario. One solution is to include a time out in the polling loop while waiting for a vertical blank. The sample Permedia2 driver is simply set to not poll at all if the monitor is powered down.

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.

 

-see-also

DD_WAITFORVERTICALBLANKDATA