XDisplayTryEnableHdrMode
Attempts to enable HDR (high dynamic range) mode for the attached display.Syntax
Parameters
displayModePreference _In_Type: XDisplayHdrModePreference Enumeration used to favor either HDR or an improved framerate up to 120Hz, in cases where both are not supported by the connected TV. displayHdrModeInfo _Out_opt_
Type: XDisplayHdrModeInfo* If HDR mode is enabled, the minimum and maximum tone map luminance values for the attached display.
Return value
Type: XDisplayHdrModeResult If the function succeeds, the return value is set to either XDisplayHdrModeResult::Enabled if HDR mode is enabled, or XDisplayHdrModeResult::Disabled if HDR mode is not enabled. If the function fails, the return value is set to XDisplayHdrModeResult::Unknown.Remarks
This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
- Your title only implements HDR and does not support 120hz at all.
- The end user has set an in-game setting indicating they don’t want 120Hz refresh rate, or they prefer HDR such as a preference for quality over performance.
- The title is in a game mode in which 120Hz refresh rate is not supported.
- You support 120hz and you or the end user has indicated that it is preferred for the current scenario (e.g. setting Prefer performance in an in game setting or game mode).
- Something changed that has swayed your preference. Most likely the user has changed the in-game setting from Prefer quality to Prefer performance.
Don’t call XDisplayTryEnableHdrMode and toggle back and forth each frame; only change when there is some specific provocation.
For more information about HDR luminance values and tone mapping, see the For a Better HDR Gaming Experience presentation on the HDR Gaming Interest Group website.
The following example attempts to enable HDR mode for the attached display. If XDisplayHdrModeInfo::Enabled is returned, then HDR mode is enabled for the display and the game uses the luminance values from the returned XDisplayHdrModeInfo structure to initialize in HDR mode; otherwise, HDR mode is either unavailable or disabled, and the game initializes in SDR (standard dynamic range) mode.
Requirements
Header: XDisplay.h Library: xgameruntime.lib Supported platforms: XBOX One family consoles and XBOX Series consolesConceptual documentation
See also
XDisplayHdrModePreferenceXDisplayHdrModeInfo
XDisplayHdrModeResult
XDisplay
