Integration of ECS pattern: Iteration 1

This commit is contained in:
Florian RICHER 2025-06-11 16:05:35 +02:00
parent fc81f65a27
commit 8ce620a74b
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
13 changed files with 727 additions and 135 deletions

View file

@ -1,5 +1,6 @@
use std::error::Error;
use bevy_ecs::world::World;
use vulkano::sync::GpuFuture;
use crate::core::app::context::WindowContext;
@ -8,12 +9,21 @@ pub mod manager;
pub trait Scene {
fn loaded(&self) -> bool;
fn load(&mut self, app_context: &mut WindowContext) -> Result<(), Box<dyn Error>>;
fn update(&mut self, app_context: &mut WindowContext) -> Result<(), Box<dyn Error>>;
fn load(
&mut self,
world: &mut World,
window_context: &mut WindowContext,
) -> Result<(), Box<dyn Error>>;
fn update(
&mut self,
world: &mut World,
window_context: &WindowContext,
) -> Result<(), Box<dyn Error>>;
fn render(
&mut self,
acquire_future: Box<dyn GpuFuture>,
app_context: &mut WindowContext,
world: &mut World,
window_context: &mut WindowContext,
) -> Result<Box<dyn GpuFuture>, Box<dyn Error>>;
fn unload(&mut self);
}