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.
As a standalone feature of this package, Meta OpenXR Display Utilities solely depends on Meta Quest Support and does not require that you enable any other feature in the Meta Quest feature group.
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 code sample 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]);
}