Only setup passthrough if requested

This commit is contained in:
Patrick Nicolas
2024-04-12 14:53:22 +02:00
parent 5d91bf0763
commit 8ebd6ae7f3
3 changed files with 12 additions and 0 deletions
+9
View File
@@ -762,7 +762,16 @@ void scenes::lobby::on_focused()
{ {
about_picture = imgui_ctx->load_texture("wivrn.png"); about_picture = imgui_ctx->load_texture("wivrn.png");
} }
setup_passthrough();
}
void scenes::lobby::setup_passthrough()
{
if (not passthrough_enabled)
{
passthrough.emplace<xr::passthrough_fb>();
return;
}
if (passthrough_supported != xr::system::passthrough_type::no_passthrough) if (passthrough_supported != xr::system::passthrough_type::no_passthrough)
{ {
if (utils::contains(system.environment_blend_modes(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO), XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND)) if (utils::contains(system.environment_blend_modes(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO), XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND))
+2
View File
@@ -127,6 +127,8 @@ class lobby : public scene_impl<lobby>
void gui_about(); void gui_about();
void gui_keyboard(ImVec2 size); void gui_keyboard(ImVec2 size);
void setup_passthrough();
void vibrate_on_hover(); void vibrate_on_hover();
void connect(server_data & data); void connect(server_data & data);
+1
View File
@@ -382,6 +382,7 @@ void scenes::lobby::gui_settings()
ImGui::BeginDisabled(passthrough_supported == xr::system::passthrough_type::no_passthrough); ImGui::BeginDisabled(passthrough_supported == xr::system::passthrough_type::no_passthrough);
if (ImGui::Checkbox("Enable video passthrough in lobby", &passthrough_enabled)) if (ImGui::Checkbox("Enable video passthrough in lobby", &passthrough_enabled))
{ {
setup_passthrough();
save_config(); save_config();
} }
vibrate_on_hover(); vibrate_on_hover();