Skip to content

Commit

Permalink
config: add use_passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Dec 7, 2024
1 parent a71f4de commit 65432eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit 65432eb

Please sign in to comment.