render: add depth buffer
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m13s

This commit is contained in:
Florian RICHER 2025-05-29 17:44:00 +02:00
parent 77c717f90b
commit 650b61e3ae
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
4 changed files with 61 additions and 21 deletions

View file

@ -1,3 +1,5 @@
use std::error::Error;
use super::{Scene, SceneContext};
pub struct SceneManager {
@ -11,14 +13,16 @@ impl SceneManager {
}
}
pub fn load_scene_if_not_loaded(&mut self, scene_context: &SceneContext) {
pub fn load_scene_if_not_loaded(
&mut self,
scene_context: &SceneContext,
) -> Result<(), Box<dyn Error>> {
if let Some(current_scene) = self.current_scene.as_mut() {
if !current_scene.loaded() {
if let Err(e) = current_scene.load(scene_context) {
log::error!("Error loading scene: {}", e);
}
current_scene.load(scene_context)?;
}
}
Ok(())
}
pub fn load_scene(&mut self, scene: Box<dyn Scene>) {