refactor: create OxrSessionConfig and make that the only way to configure things like BlendModes

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-05-02 16:43:39 +02:00
parent 4074d4be7c
commit be6a053b55
7 changed files with 88 additions and 93 deletions

View File

@@ -3,7 +3,7 @@
use bevy::prelude::*;
use bevy_mod_openxr::{
add_xr_plugins, features::overlay::OxrOverlaySessionEvent, init::OxrInitPlugin,
types::OxrExtensions,
resources::OxrSessionConfig, types::OxrExtensions,
};
use openxr::EnvironmentBlendMode;
@@ -16,14 +16,17 @@ fn main() {
exts.extx_overlay = true;
exts
},
..OxrInitPlugin::default()
}))
.insert_resource(OxrSessionConfig {
blend_modes: Some({
vec![
EnvironmentBlendMode::ALPHA_BLEND,
EnvironmentBlendMode::OPAQUE,
]
}),
..OxrInitPlugin::default()
}))
..OxrSessionConfig::default()
})
.insert_resource(ClearColor(Color::NONE))
.add_plugins(bevy_xr_utils::hand_gizmos::HandGizmosPlugin)
.add_systems(Startup, setup)