From 2860c7ce09fbf2c30ce4bc48df3fce708e734339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mon=20ou=C3=AFe?= Date: Fri, 1 Dec 2023 06:54:53 +0100 Subject: Allow stereo 3D content to play in overlay mode --- src/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index cf0ce8e..7d526b8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1209,6 +1209,16 @@ bool CMainApplication::BInitOverlay() vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_SendVRDiscreteScrollEvents, true); vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_VisibleInDashboard, true); + if (projection_mode == ProjectionMode::SPHERE360) + vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_Panorama, true); + else if (view_mode == ViewMode::LEFT_RIGHT) + vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_SideBySide_Parallel, true); + else if (view_mode == ViewMode::RIGHT_LEFT) + vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_SideBySide_Crossed, true); + + if (projection_mode == ProjectionMode::FLAT && stretch) + vr::VROverlay()->SetOverlayTexelAspect(overlay_handle, 2.0); + vr::VROverlay()->SetOverlayFromFile(thumbnail_handle, "frog.png"); overlay_xdo = xdo_new_with_opened_display(x_display, nullptr, 0); @@ -1899,6 +1909,8 @@ void CMainApplication::RenderFrame() if (!overlay_mode) UpdateHMDMatrixPose(); + else + vr::VROverlay()->WaitFrameSync(20); } //----------------------------------------------------------------------------- -- cgit v1.2.3