Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: add use_passthrough #116

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/backend/openxr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
stage_offset: Affine3A::IDENTITY,
};

let mut skybox = if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE {
let mut skybox = if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE
|| !app_state.session.config.use_passthrough
{
create_skybox(&xr_state, &app_state)
} else {
None
Expand Down Expand Up @@ -222,7 +224,9 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
if main_session_visible {
log::debug!("Destroying skybox.");
skybox = None;
} else if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE {
} else if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE
|| !app_state.session.config.use_passthrough
{
log::debug!("Allocating skybox.");
skybox = create_skybox(&xr_state, &app_state);
}
Expand Down
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ pub struct GeneralConfig {
#[serde(default = "def_true")]
pub use_skybox: bool,

#[serde(default = "def_true")]
pub use_passthrough: bool,

#[serde(default = "def_max_height")]
pub screen_max_height: u16,

Expand Down