> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XDisplayHdrModePreference

> XDisplayHdrModePreference

# XDisplayHdrModePreference

Specifies the preferred mode to use when calling [XDisplayTryEnableHdrMode](/reference/system/xdisplay/functions/xdisplaytryenablehdrmode).

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
enum class XDisplayHdrModePreference  : uint32_t
{
    PreferHdr = 0,
    PreferRefreshRate = 1
}
```

<a id="constantsSection" />

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

<a id="remarksSection" />

## Remarks

For more information about HDR support, see [High Dynamic Range (HDR) output (NDA topic)](/build/core-features/graphics/overviews/hdr-support).

For information about HDR luminance values and tone mapping, see the [For a Better HDR Gaming Experience](https://www.hgig.org/doc/ForBetterHDRGaming.pdf) 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](/reference/system/xdisplay/enums/xdisplayhdrmoderesult) 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.

```cpp theme={null}
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();
    }
}
```

<a id="requirementsSection" />

## Requirements

**Header:** XDisplay.h

**Supported Platforms**: Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[XDisplayTryEnableHdrMode](/reference/system/xdisplay/functions/xdisplaytryenablehdrmode)\
[XDisplay](/reference/system/xdisplay/xdisplay_members)\
[High dynamic range (HDR) output (NDA topic)](/build/core-features/graphics/overviews/hdr-support)


## Related topics

- [XDisplayTryEnableHdrMode](/reference/system/xdisplay/functions/xdisplaytryenablehdrmode.md)
- [XDisplay](/reference/system/xdisplay/xdisplay_members.md)
- [XDisplayHdrModeInfo](/reference/system/xdisplay/structs/xdisplayhdrmodeinfo.md)
- [XDisplayHdrModeResult](/reference/system/xdisplay/enums/xdisplayhdrmoderesult.md)
- [XR-131 Display Mode Support for Game DVR and Screenshots](/publishing/certification/xr/xr-131.md)
