DXUTFindValidDeviceSettings

Finds valid device settings to be used to create a new device.

HRESULT DXUTFindValidDeviceSettings(
  DXUTDeviceSettings * pOut,
  DXUTDeviceSettings * pIn,
  DXUTMatchOptions * pMatchOptions
);

Parameters

pOut
[out] Pointer to a DXUTDeviceSettings structure that contains valid settings for the new device.
pIn
[in] Pointer to a DXUTDeviceSettings structure that contains desired settings for the new device. The default value is NULL.
pMatchOptions
[in] Pointer to a DXUTMatchOptions structure that contains flags describing how to use the device settings when choosing valid output device settings. Optimal device settings will be created based upon the match values in DXUTMatchOptions. If NULL, the function acts as if all members of this structure were DXUTMT_IGNORE_INPUT, meaning that the function will return valid device settings as close as possible to default device settings. See Remarks. The default value is NULL.

Return Values

If the function succeeds, the return value is S_OK. If the function fails, the return value can be one of the error codes in DXUTERR.

Remarks

This function attempts to find valid device settings based upon the input device settings, given by pIn. For each device setting, a match option in the DXUTDeviceSettings structure specifies how the function makes decisions. For example, suppose the application needs a hal device with a back buffer format of D3DFMT_A2B10G10R10, but the hal device on the system does not support that format. If, however, a reference device is installed that does support the D3DFMT_A2B10G10R10 format, then the function has a choice to either use the reference device or to change to a back buffer format compatible with the HAL device. The match options in DXUTMatchOptions let the application control how these choices are made.

This function is internally used when toggling between full screen and windowed modes, when selecting between hal and reference devices, and in DXUTCreateDevice.

Requirements

Header: Declared in Dxut.h.

See Also

DXUTMatchOptions, DXUTCreateDeviceFromSettings