From 23ac74415d608615ec537ced22491d5e67e35d72 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Thu, 7 Sep 2023 21:53:29 +0200 Subject: [PATCH] d/steamvr_lh: Add support for new SteamVR display component v3 interface First try v3 then fallback to v2 should it not be available. --- src/external/openvr_includes/openvr_driver.h | 1 + src/xrt/drivers/steamvr_lh/steamvr_lh.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/external/openvr_includes/openvr_driver.h b/src/external/openvr_includes/openvr_driver.h index 27e08cb84..703243fb1 100644 --- a/src/external/openvr_includes/openvr_driver.h +++ b/src/external/openvr_includes/openvr_driver.h @@ -2743,6 +2743,7 @@ namespace vr }; static const char *IVRDisplayComponent_Version = "IVRDisplayComponent_002"; + static const char *IVRDisplayComponent_Version3 = "IVRDisplayComponent_003"; } diff --git a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp index 2f6fb16a0..31b443f76 100644 --- a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp +++ b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp @@ -140,7 +140,10 @@ Context::setup_hmd(const char *serial, vr::ITrackedDeviceServerDriver *driver) vr::EVRInitError err = driver->Activate(0); VERIFY(err == vr::VRInitError_None, std::to_string(err).c_str()); - auto *display = static_cast(driver->GetComponent(vr::IVRDisplayComponent_Version)); + auto *display = static_cast(driver->GetComponent(vr::IVRDisplayComponent_Version3)); + if (display == NULL) { + display = static_cast(driver->GetComponent(vr::IVRDisplayComponent_Version)); + } VERIFY(display, "IVRDisplayComponent is null"); #undef VERIFY