// d3dumddi.h
PFND3DDDI_SETDISPLAYMODE Pfnd3dddiSetdisplaymode;
HRESULT Pfnd3dddiSetdisplaymode(
HANDLE hDevice,
const D3DDDIARG_SETDISPLAYMODE *unnamedParam2
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The SetDisplayMode function switches to a display mode or primary that is not supported by the GDI desktop.
hDeviceA handle to the display device (graphics context).
unnamedParam2pData [in]
A pointer to a D3DDDIARG_SETDISPLAYMODE structure that specifies parameters for setting the display mode.
SetDisplayMode returns S_OK or an appropriate error result if the display mode is not successfully set.
The Microsoft Direct3D runtime calls SetDisplayMode to switch to a display mode or primary that is not supported by the GDI desktop. The following list describes examples of such primaries:
The Direct3D runtime calls the user-mode display driver's CreateResource function to create the primary to be scanned out. However, the driver should program the hardware to scan out only when its SetDisplayMode function is called. Therefore, the runtime sets the hResource and SubResourceIndex members of the D3DDDIARG_SETDISPLAYMODE structure that is pointed to by the pData parameter to the primary that was created through the call to the driver's CreateResource function. The driver should then translate the primary that is represented by hResource and SubResourceIndex to a primary allocation handle. After the driver makes this translation, the driver should pass the resulting handle in a call to the pfnSetDisplayModeCb function, which then initiates a call to the display miniport driver's DxgkDdiCommitVidPn function.
The user-mode display driver can set the hPrimaryAllocation member of the D3DDDICB_SETDISPLAYMODE structure in the call to pfnSetDisplayModeCb to scan out any allocation. However, the allocation must be marked as a primary (that is, the user-mode display driver must have set the Primary bit-field flag in the Flags member of the D3DDDI_ALLOCATIONINFO structure in a call to the pfnAllocateCb function to create the allocation).