This commit is contained in:
Florian RICHER 2025-04-13 16:35:21 +02:00
parent b361965033
commit f4694157ab
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
8 changed files with 143 additions and 3 deletions

24
src/core/window/mod.rs Normal file
View file

@ -0,0 +1,24 @@
pub mod window_handler;
use super::app::{App, plugin::Plugin};
use window_handler::WindowHandler;
use winit::event_loop::EventLoop;
use winit::window::WindowAttributes;
pub struct WindowPlugin {
window_attributes: WindowAttributes,
event_loop: EventLoop<()>,
}
impl Plugin for WindowPlugin {
fn build(&self, app: &mut App) {
let world = app.world_mut();
world.insert_resource(WindowHandler::new(self.window_attributes.clone()));
let window_handler = world.get_resource_mut::<WindowHandler>().unwrap();
// app.set_runner(Box::new(move || {
// self.event_loop.run_app(&mut window_handler);
// }));
}
}