hook up winit impl to examples

This commit is contained in:
griffi-gh 2024-02-29 16:11:29 +01:00
parent ad0e6fd7e6
commit 4745dcad1d
2 changed files with 2 additions and 0 deletions

View file

@ -8,6 +8,7 @@ publish = false
[dev-dependencies] [dev-dependencies]
hui = { path = "../hui" } hui = { path = "../hui" }
hui-glium = { path = "../hui-glium" } hui-glium = { path = "../hui-glium" }
hui-winit = { path = "../hui-winit" }
kubi-logging = { git = "https://github.com/griffi-gh/kubi", rev = "c162893fd" } kubi-logging = { git = "https://github.com/griffi-gh/kubi", rev = "c162893fd" }
glium = "0.34" glium = "0.34"
winit = "0.29" winit = "0.29"

View file

@ -28,6 +28,7 @@ pub fn ui(mut x: impl FnMut(&mut UiInstance, Vec2)) {
event_loop.run(|event, window_target| { event_loop.run(|event, window_target| {
window_target.set_control_flow(ControlFlow::Poll); window_target.set_control_flow(ControlFlow::Poll);
hui_winit::handle_winit_event(&mut hui, &event);
match event { match event {
Event::WindowEvent { event: WindowEvent::CloseRequested, .. } => { Event::WindowEvent { event: WindowEvent::CloseRequested, .. } => {
window_target.exit(); window_target.exit();