wip: Changes of the week

- Move engine to a different crate
- Add engine trait
- Refactor the rest of the codebase to work with these changes
- Add debug ui buffer, use it to finish imgui support
This commit is contained in:
reo 2025-09-07 17:00:04 +03:00
parent 3fd5b09a94
commit 15122b8ebd
20 changed files with 344 additions and 117 deletions

View file

@ -1,23 +1,26 @@
use std::cell::RefCell;
use std::rc::Rc;
use raidillon_core::Scene;
use raidillon_core::scene::Scene;
use glium::{Display, Frame};
use glium::glutin::surface::WindowSurface;
use indexmap::IndexMap;
use raidillon_assets::ModelManagerRef;
use raidillon_core::DebugUIBuffer;
use crate::GliumAssetManager;
pub struct RenderingContext<'a> {
pub scene: &'a Scene,
pub target: &'a mut Frame,
pub window: &'a mut glium::winit::window::Window,
pub asset_manager: ModelManagerRef,
pub debug_ui_buffer: Rc<RefCell<DebugUIBuffer>>,
}
/// The internal "rendering system" trait of glium_platform.
/// This is unrelated to the main System trait in core.
pub trait RenderingSystem {
fn render(&mut self, ctx: &mut RenderingContext);
fn initialize(display: &Display<WindowSurface>) -> Self where Self: Sized;
fn initialize(display: &Display<WindowSurface>, window: &glium::winit::window::Window) -> Self where Self: Sized;
}
pub type SystemID = &'static str;