aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMon ouïe <mon.ouie@gmail.com>2023-12-01 06:54:53 +0100
committerMon ouïe <mon.ouie@gmail.com>2023-12-01 06:54:53 +0100
commit2860c7ce09fbf2c30ce4bc48df3fce708e734339 (patch)
tree33d1eb29e36685a8707898a191beb79a6b306505 /src
parente8253dcaa4dfdfefea3db112c300104afe7ce42b (diff)
Allow stereo 3D content to play in overlay mode
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp12
1 files changed, 12 insertions, 0 deletions
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);
}
//-----------------------------------------------------------------------------