allow toggling skybox during runtime

This commit is contained in:
Sapphire
2026-01-20 21:43:15 -06:00
committed by galister
parent d23b058d0e
commit 3ac6f70725
2 changed files with 6 additions and 5 deletions

View File

@@ -174,12 +174,16 @@ pub fn openxr_run(show_by_default: bool, headless: bool) -> Result<(), BackendEr
};
match (environment_blend_mode, skybox.as_ref()) {
(xr::EnvironmentBlendMode::OPAQUE, None) if !main_session_visible => {
(xr::EnvironmentBlendMode::OPAQUE, None)
if app.session.config.use_skybox && !main_session_visible =>
{
log::debug!("Allocating skybox.");
skybox = create_skybox(&xr_state, &app);
}
(blend_mode, Some(_))
if blend_mode != xr::EnvironmentBlendMode::OPAQUE || main_session_visible =>
if blend_mode != xr::EnvironmentBlendMode::OPAQUE
|| !app.session.config.use_skybox
|| main_session_visible =>
{
log::debug!("Destroying skybox.");
skybox = None;

View File

@@ -251,9 +251,6 @@ impl Skybox {
}
pub(super) fn create_skybox(xr: &XrState, app: &AppState) -> Option<Skybox> {
if !app.session.config.use_skybox {
return None;
}
xr.instance
.exts()
.khr_composition_layer_equirect2