render: add depth buffer
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m13s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m13s
This commit is contained in:
parent
77c717f90b
commit
650b61e3ae
4 changed files with 61 additions and 21 deletions
|
@ -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>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue