Display Utilities
The Meta Quest Display Utilities feature enables you to:
- Get the supported display refresh rates for the device.
- Request a selected display refresh rate.
Enable Display Utilities
To enable Meta Quest Display Utilities in your app:
- Go to Project Settings > XR Plug-in Management > OpenXR.
- Under OpenXR Feature Groups, select the Meta Quest feature group.
- If disabled, enable the Meta Quest Display Utilities OpenXR feature.
Code sample
Once enabled, Meta Quest Display Utilities adds additional capabilities to Unity's XRDisplaySubsystem using C# extension methods: TryGetSupportedDisplayRefreshRates and TryRequestDisplayRefreshRate.
Important
These extension methods will always return false if you did not Enable Display Utilities in XR Plug-in Management.
The example code below demonstrates how to use these extension methods:
// Omitted null checks for brevity. You should check each line for null.
var displaySubsystem = XRGeneralSettings.Instance
.Manager
.activeLoader
.GetLoadedSubsystem<XRDisplaySubsystem>();
// Get the supported refresh rates.
// If you will save the refresh rate values for longer than this frame, pass
// Allocator.Persistent and remember to Dispose the array when you are done with it.
if (displaySubsystem.TryGetSupportedDisplayRefreshRates(
Allocator.Temp,
out var refreshRates))
{
// Request a refresh rate.
// Returns false if you request a value that is not in the refreshRates array.
bool success = displaySubsystem.TryRequestDisplayRefreshRate(refreshRates[0]);
}