# XRDisplayRefreshRateFeature

This OpenXRInteractionFeature provides access to the XR_FB_display_refresh_rate extension.

## Summary

### Inheritance

Inherits from: `OpenXRFeature`

|                                                                                                                                                      ### Public attributes                                                                                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| [ExtensionString](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRDisplayRefreshRateFeature#extensionstring)` = "XR_FB_display_refresh_rate"`        | `const string` The OpenXR Extension string.                                                                                         |
| [FeatureId](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRDisplayRefreshRateFeature#featureid)` = "com.google.xr.extensions.display_refresh_rate"` | `const string` The feature ID string.                                                                                               |
| [UiName](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRDisplayRefreshRateFeature#uiname)` = "Display Refresh Rate"`                                | `const string` The UI name shows on the XR Plug-in Management panel, to help users understand validation errors and expected fixes. |

|                                                                                                       ### Public static attributes                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [IsExtensionEnabled](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRDisplayRefreshRateFeature#isextensionenabled)` => _extensionEnabled` | `bool` Gets if the required OpenXR extension is enabled. |

|                                                                                                                                                                                                                                ### Public static functions                                                                                                                                                                                                                                ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [GetDisplayRefreshRateInfo](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRDisplayRefreshRateFeature#getdisplayrefreshrateinfo)`(out `[XRDisplayRefreshRateInfo](https://developer.android.com/develop/xr/unity/reference/struct/Google/XR/Extensions/XRDisplayRefreshRateInfo#structGoogle_1_1XR_1_1Extensions_1_1XRDisplayRefreshRateInfo)` info)` | `bool` Gets the refresh rates supported by the device and the device's current refresh rate. |
| [RequestDisplayRefreshRate](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRDisplayRefreshRateFeature#requestdisplayrefreshrate)`(float displayRefreshRate)`                                                                                                                                                                                          | `void` Request the system to dynamically change the display refresh rate.                    |

## Public attributes

### ExtensionString

```c#
const string ExtensionString = "XR_FB_display_refresh_rate"
```  
The OpenXR Extension string.

Used to check if this extension is available or enabled.  

### FeatureId

```c#
const string FeatureId = "com.google.xr.extensions.display_refresh_rate"
```  
The feature ID string.  

### UiName

```c#
const string UiName = "Display Refresh Rate"
```  
The UI name shows on the XR Plug-in Management panel, to help users understand validation errors and expected fixes.

## Public static attributes

### IsExtensionEnabled

```c#
bool IsExtensionEnabled => _extensionEnabled
```  
Gets if the required OpenXR extension is enabled.

When OpenXR runtime is waiting, it returns `null`. Otherwise, it indicates whether the XR_FB_display_refresh_rate extension is available on the current device.

## Public static functions

### GetDisplayRefreshRateInfo

```c#
bool GetDisplayRefreshRateInfo(
  out XRDisplayRefreshRateInfo info
)
```  
Gets the refresh rates supported by the device and the device's current refresh rate.


|                                                            Details                                                            ||
|------------|-------------------------------------------------------------------------------------------------------------------|
| Parameters | |--------|---------------------------------------------| | `info` | Refresh rate info obtained from the system. | |

### RequestDisplayRefreshRate

```c#
void RequestDisplayRefreshRate(
  float displayRefreshRate
)
```  
Request the system to dynamically change the display refresh rate.

Note that this is only a request and does not guarantee the system will switch to the requested display refresh rate.


|                                                                                                                                                                                            Details                                                                                                                                                                                            ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters | |----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| | `displayRefreshRate` | The value must be 0.0f or one of the supported refresh rates returned by GetDisplayRefreshRateInfo. A value 0.0f indicates the application has no preference. | |