docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MetaOpenXRDisplaySubsystemExtensions

    Meta OpenXR extension methods for the XRDisplaySubsystem.

    Important

    These extension methods require that you enable the Meta OpenXR Display Utilities feature in Project Settings > XR Plug-in Management > OpenXR. If the display utilities feature is not enabled, all extension methods will return false.

    Inheritance
    object
    MetaOpenXRDisplaySubsystemExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.OpenXR.Features.Meta
    Assembly: Unity.XR.MetaOpenXR.dll
    Syntax
    public static class MetaOpenXRDisplaySubsystemExtensions

    Methods

    TryGetSupportedDisplayRefreshRates(XRDisplaySubsystem, Allocator, out NativeArray<float>)

    Attempts to get the supported display refresh rates for the device.

    Declaration
    public static bool TryGetSupportedDisplayRefreshRates(this XRDisplaySubsystem subsystem, Allocator allocator, out NativeArray<float> refreshRates)
    Parameters
    Type Name Description
    XRDisplaySubsystem subsystem

    The subsystem instance used by this extension method.

    Allocator allocator

    The allocator strategy to use for the refreshRates out parameter.

    NativeArray<float> refreshRates

    A NativeArray containing all supported display refresh rates. You are responsible to Dispose this if you pass Persistent as your allocator strategy.

    Returns
    Type Description
    bool

    true if refreshRates was successfully written. Otherwise, false.

    Remarks
    Important

    This extension method requires that you enable the Meta OpenXR Display Utilities feature in Project Settings > XR Plug-in Management > OpenXR. If the display utilities feature is not enabled, this method will always return false.

    See Also
    DisplayUtilitiesFeature

    TryRequestDisplayRefreshRate(XRDisplaySubsystem, float)

    Attempts to request a change to the current display refresh rate. If the request is successfully created, Meta's OpenXR runtime is expected to change the display refresh rate on a subsequent frame.

    Declaration
    public static bool TryRequestDisplayRefreshRate(this XRDisplaySubsystem subsystem, float refreshRate)
    Parameters
    Type Name Description
    XRDisplaySubsystem subsystem

    The subsystem instance used by this extension method.

    float refreshRate

    The requested refresh rate. Must be an element of the array output from TryGetSupportedDisplayRefreshRates.

    Returns
    Type Description
    bool

    true if the request was successfully created. Otherwise, false.

    Remarks
    Important

    This extension method requires that you enable the Meta OpenXR Display Utilities feature in Project Settings > XR Plug-in Management > OpenXR. If the display utilities feature is not enabled, this method will always return false.

    See Also
    TryGetDisplayRefreshRate(out float)

    See Also

    DisplayUtilitiesFeature
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)