Retrieves the current display mode and rotation settings of the adapter.
HRESULT GetAdapterDisplayModeEx( [in] UINT Adapter, [in, out] D3DDISPLAYMODEEX *pMode, [in, out] D3DDISPLAYROTATION *pRotation );
- Adapter [in]
Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.
- pMode [in, out]
Pointer to a D3DDISPLAYMODEEX structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode. Can be set to NULL.
- pRotation [in, out]
Pointer to a D3DDISPLAYROTATION structure indicating the type of screen rotation the application will do. The value returned through this pointer is important when the D3DPRESENTFLAG_NOAUTOROTATE flag is used; otherwise, it can be set to NULL.
If the method succeeds, the return value is D3D_OK.
If Adapter is out of range or pMode is invalid, this method returns D3DERR_INVALIDCALL.
GetAdapterDisplayModeEx does not return the correct format when the display is in an extended format, such as 2:10:10:10. Instead, it returns the format X8R8G8B8.
To windowed applications, a value of S_PRESENT_MODE_CHANGED returned from PresentEx or CheckDeviceState indicates that the display mode changed and that the current display mode might have a different format. To avoid a color-converting Present blt, windowed applications can optionally get new display mode information by using this method and adjusting its swap chain format accordingly. This method returns D3DERR_NOTAVAILABLE if this head is no longer part of the desktop or if the monitor is disconnected.