Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read display refresh rate in UnityXR #550

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Assets/Scripts/VrSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Linq;
using UnityEngine;
using UnityEngine.XR;
using UnityEngine.XR.Management;

#if PICO_SUPPORTED
using PicoInput = Unity.XR.PXR.PXR_Input;
Expand Down Expand Up @@ -740,7 +741,7 @@ public bool IsHmdInitialized()
switch (App.Config.m_SdkMode)
{
case SdkMode.UnityXR:
return UnityEngine.XR.Management.XRGeneralSettings.Instance.Manager.activeLoader != null;
return XRGeneralSettings.Instance.Manager.activeLoader != null;
default:
return true;
}
Expand All @@ -752,6 +753,11 @@ public int GetHmdTargetFrameRate()
switch (App.Config.m_SdkMode)
{
case SdkMode.UnityXR:
if (XRGeneralSettings.Instance.Manager.activeLoader.GetLoadedSubsystem<XRDisplaySubsystem>().TryGetDisplayRefreshRate(out float rate))
{
Debug.Log($"Subsystem refresh rate: {rate}");
return (int)rate;
}
return 60; // 90?
case SdkMode.Monoscopic:
return 60;
Expand Down
Loading