IDXGIOutput::FindClosestMatchingMode method

[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.

Syntax

HRESULT FindClosestMatchingMode(
  const DXGI_MODE_DESC *pModeToMatch,
  DXGI_MODE_DESC       *pClosestMatch,
  IUnknown             *pConcernedDevice
);

Parameters

pModeToMatch

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, Formatcannot be DXGI_FORMAT_UNKNOWN.

pClosestMatch

Type: DXGI_MODE_DESC*

The mode that most closely matches pModeToMatch.

pConcernedDevice

Type: IUnknown*

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:

Return Value

Type: HRESULT

Returns one of the following DXGI_ERROR.

Remarks

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.

Requirements

   
Target Platform Windows
Header dxgi.h
Library DXGI.lib

See Also

IDXGIOutput