PFND3DDDI_SETDISPLAYMODECB callback function

The pfnSetDisplayModeCb function sets the allocation that is used to scan out to the display.

Syntax

PFND3DDDI_SETDISPLAYMODECB Pfnd3dddiSetdisplaymodecb;

HRESULT Pfnd3dddiSetdisplaymodecb(
  HANDLE hDevice,
  D3DDDICB_SETDISPLAYMODE *
)
{...}

Parameters

hDevice

A handle to the display device (graphics context).

*

Return Value

pfnSetDisplayModeCb returns one of the following values:

S_OK
The display mode was successfully set.
E_INVALIDARG
Parameters were validated and determined to be incorrect.

D3DDDIERR_INCOMPATIBLEPRIVATEFORMAT
The user-mode display driver must convert the format of the surface that is associated with the allocation that the hPrimaryAllocation member of D3DDDICB_SETDISPLAYMODE specifies into the format attribute that the PrivateDriverFormatAttribute member of D3DDDICB_SETDISPLAYMODE specifies. The driver should then call pfnSetDisplayModeCb again. The driver could allocate a new allocation, perform a conversion bit-block transfer (bitblt) from the old primary surface to the new, and then destroy the old primary as long as the driver uses the new allocation handle for this allocation for all subsequent operations. The driver should repeat this process until pfnSetDisplayModeCb returns a different return value. This function might also return other HRESULT values. ## Remarks After the Microsoft Direct3D runtime calls the user-mode display driver's SetDisplayMode or SetDisplayModeDXGI function to set the primary surface to be scanned out to the display, the user-mode display driver calls the pfnSetDisplayModeCb function to set the underlying primary allocation that is used for scanning out. Direct3D Version 11 Note: For more information about how the driver calls pfnSetDisplayModeCb, see Changes from Direct3D 10. Direct3D Version 11 Note: For more information about how the driver calls pfnSetDisplayModeCb, see Changes from Direct3D 10. The following code example shows how to set the allocation for scanning out to the display. ## Requirements |   |   | | ---- |:---- | | Windows Driver kit version | | | Target platform | Desktop | | Minimum KMDF version | | | Minimum UMDF version | | | Header | d3dumddi.h (include D3dumddi.h) | | Library | | | IRQL | | | DDI compliance rules | | ## See Also
D3DDDICB_SETDISPLAYMODE
D3DDDI_DEVICECALLBACKS
SetDisplayMode
SetDisplayModeDXGI

Send comments about this topic to Microsoft