egui support
- New Resource, EguiQueue: Utility to queue egui ui builders - New Rendering System, EguiRenderer: Utilizes a modified egui_glium library to render egui UI - Adjusted RenderingSystem trait and RenderingContext structure to provide event_loop and egui_queue. - Various minor adjusments
This commit is contained in:
parent
e88ce258ce
commit
ce24354f3b
18 changed files with 806 additions and 204 deletions
|
|
@ -6,16 +6,19 @@ use indexmap::IndexMap;
|
|||
use glium::{Display, Frame};
|
||||
use glium::glutin::surface::WindowSurface;
|
||||
use raidillon_assets::ModelManagerRef;
|
||||
use raidillon_core::{define_typemap, DebugUIBuffer};
|
||||
use raidillon_core::{define_typemap, DebugUIBuffer, EguiQueue};
|
||||
use raidillon_core::scene::Scene;
|
||||
use glam::Vec3;
|
||||
use winit::event_loop::EventLoop;
|
||||
|
||||
pub struct RenderingContext<'a> {
|
||||
pub scene: &'a Scene,
|
||||
pub target: &'a mut Frame,
|
||||
pub window: Arc<Mutex<glium::winit::window::Window>>,
|
||||
pub display: &'a Display<WindowSurface>,
|
||||
pub asset_manager: ModelManagerRef,
|
||||
pub debug_ui_buffer: &'a DebugUIBuffer,
|
||||
pub egui_queue: Rc<RefCell<EguiQueue>>,
|
||||
pub env_light_dir: Vec3,
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +33,7 @@ pub trait RenderingSystem {
|
|||
}
|
||||
fn prepare_frame(&mut self, _window: Arc<Mutex<glium::winit::window::Window>>) {}
|
||||
fn render(&mut self, ctx: &mut RenderingContext);
|
||||
fn initialize(display: &Display<WindowSurface>, window: Arc<Mutex<glium::winit::window::Window>>) -> Self
|
||||
fn initialize(display: &Display<WindowSurface>, window: Arc<Mutex<glium::winit::window::Window>>, event_loop: &EventLoop<()>) -> Self
|
||||
where
|
||||
Self: Sized;
|
||||
}
|
||||
|
|
@ -48,11 +51,11 @@ impl RenderingSystemManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn add<R>(&mut self, display: &Display<WindowSurface>, window: Arc<Mutex<glium::winit::window::Window>>)
|
||||
pub fn add<R>(&mut self, display: &Display<WindowSurface>, window: Arc<Mutex<glium::winit::window::Window>>, event_loop: &EventLoop<()>)
|
||||
where
|
||||
R: RenderingSystem + 'static,
|
||||
{
|
||||
let system = R::initialize(display, window);
|
||||
let system = R::initialize(display, window, event_loop);
|
||||
self.systems.insert(TypeId::of::<R>(), Box::new(system));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue