d/steamvr_lh: Add support for new SteamVR display component v3 interface

First try v3 then fallback to v2 should it not be available.
This commit is contained in:
Gabriele Musco 2023-09-07 21:53:29 +02:00 committed by Jakob Bornecrantz
parent 9f61b47415
commit 23ac74415d
2 changed files with 5 additions and 1 deletions

View file

@ -2743,6 +2743,7 @@ namespace vr
};
static const char *IVRDisplayComponent_Version = "IVRDisplayComponent_002";
static const char *IVRDisplayComponent_Version3 = "IVRDisplayComponent_003";
}

View file

@ -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<vr::IVRDisplayComponent *>(driver->GetComponent(vr::IVRDisplayComponent_Version));
auto *display = static_cast<vr::IVRDisplayComponent *>(driver->GetComponent(vr::IVRDisplayComponent_Version3));
if (display == NULL) {
display = static_cast<vr::IVRDisplayComponent *>(driver->GetComponent(vr::IVRDisplayComponent_Version));
}
VERIFY(display, "IVRDisplayComponent is null");
#undef VERIFY