XDisplayHdrModePreference

Specifies the preferred mode to use when calling XDisplayTryEnableHdrMode.

Syntax

enum class XDisplayHdrModePreference  : uint32_t
{
    PreferHdr = 0,
    PreferRefreshRate = 1
}

Constants

Constant Description
PreferHdr HDR is preferred over a higher refresh rate when the display doesn't support both simultaneously.
PreferRefreshRate 120 Hz refresh rate is preferred over HDR when the display doesn't support both simultaneously.

Remarks

For more information about HDR support, see High Dynamic Range (HDR) output (NDA topic)Authorization required.

For information about HDR luminance values and tone mapping, see the For a Better HDR Gaming Experience presentation on the HDR Gaming Interest Group website.

Example

The following code example demonstrates how to enable HDR mode for an attached display. If XDisplayHdrModeInfo::Enabled is returned, then HDR mode is enabled for the display, and the game can choose to use the luminance values from the returned XDisplayHdrModeInfo structure to optimize the rendered HDR image for the attached display's capabilities. Otherwise, HDR mode is either unavailable, or it is disabled, and the game initializes in standard dynamic range (SDR) mode.

void Game::InitializeHDRMode() 
{
    // Attempt to enable HDR mode, then initialize based on the 
    // result of the attempt.
    XDisplayHdrModeInfo displayModeHdrInfo;

    if (XDisplayHdrModeResult::Enabled == XDisplayTryEnableHdrMode(XDisplayHdrModePreference::PreferHdr, &displayModeHdrInfo))
    {
        // HDR mode is enabled for the attached display.
        InitializeAsHDR(
            displayModeHdrInfo.minToneMapLuminance,
            displayModeHdrInfo.maxToneMapLuminance,
            displayModeHdrInfo.maxFullFrameToneMapLuminance);
    }
    else
    {
        // Either HDR mode is disabled for the attached display, or the
        // attached display does not support HDR.
        InitializeAsSDR();
    }
}

Requirements

Header: XDisplay.h

Supported Platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XDisplayTryEnableHdrMode
XDisplay
High dynamic range (HDR) output (NDA topic)Authorization required