IDXGIOutput::FindClosestMatchingMode method (dxgi.h)
[Starting with Direct3D 11.1, we recommend not to use FindClosestMatchingMode anymore to find the display mode that most closely matches the requested display mode. Instead, use IDXGIOutput1::FindClosestMatchingMode1, which supports stereo display mode.]
Finds the display mode that most closely matches the requested display mode.
HRESULT FindClosestMatchingMode( [in] const DXGI_MODE_DESC *pModeToMatch, [out] DXGI_MODE_DESC *pClosestMatch, [in, optional] IUnknown *pConcernedDevice );
Type: const DXGI_MODE_DESC*
The desired display mode (see DXGI_MODE_DESC). Members of DXGI_MODE_DESC can be unspecified indicating no preference for that member. A value of 0 for Width or Height indicates the value is unspecified. If either Width or Height are 0, both must be 0. A numerator and denominator of 0 in RefreshRate indicate it is unspecified. Other members of DXGI_MODE_DESC have enumeration values indicating the member is unspecified. If pConcernedDevice is NULL, Format cannot be DXGI_FORMAT_UNKNOWN.
The mode that most closely matches pModeToMatch.
[in, optional] pConcernedDevice
A pointer to the Direct3D device interface. If this parameter is NULL, only modes whose format matches that of pModeToMatch will be returned; otherwise, only those formats that are supported for scan-out by the device are returned. For info about the formats that are supported for scan-out by the device at each feature level:
- DXGI Format Support for Direct3D Feature Level 12.1 Hardware
- DXGI Format Support for Direct3D Feature Level 12.0 Hardware
- DXGI Format Support for Direct3D Feature Level 11.1 Hardware
- DXGI Format Support for Direct3D Feature Level 11.0 Hardware
- Hardware Support for Direct3D 10Level9 Formats
- Hardware Support for Direct3D 10.1 Formats
- Hardware Support for Direct3D 10 Formats
Returns one of the following DXGI_ERROR.
FindClosestMatchingMode behaves similarly to the IDXGIOutput1::FindClosestMatchingMode1 except FindClosestMatchingMode considers only the mono display modes. IDXGIOutput1::FindClosestMatchingMode1 considers only stereo modes if you set the Stereo member in the DXGI_MODE_DESC1 structure that pModeToMatch points to, and considers only mono modes if Stereo is not set.
IDXGIOutput1::FindClosestMatchingMode1 returns a matched display-mode set with only stereo modes or only mono modes. FindClosestMatchingMode behaves as though you specified the input mode as mono.