Push break job work [not work]
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 7m55s

This commit is contained in:
Florian RICHER 2025-05-26 16:46:26 +02:00
parent e58c22b531
commit 5b74eef561
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
13 changed files with 118 additions and 18 deletions

29
src/core/scene.rs Normal file
View file

@ -0,0 +1,29 @@
use vulkano_util::renderer::VulkanoWindowRenderer;
use super::{input::InputState, render::vulkan_context::VulkanContext, timer::Timer};
pub trait Scene {
fn load(&mut self, app: &mut App);
fn update(&mut self, app: &mut App);
fn render(&self);
fn unload(&mut self);
}
pub struct SceneManager {
current_scene: Option<Box<dyn Scene>>,
}
impl SceneManager {
pub fn new() -> Self {
Self {
current_scene: None,
}
}
pub fn load_scene(&mut self, scene: Box<dyn Scene>) {
if let Some(current_scene) = self.current_scene.as_mut() {
current_scene.unload();
}
self.current_scene = Some(scene);
}
}