Exit when window is closed

This commit is contained in:
Hanno Braun 2024-10-30 02:40:37 +01:00
parent 2b5403530a
commit aa61ee52fe

View File

@ -41,7 +41,7 @@ impl ApplicationHandler for App {
fn window_event(
&mut self,
_: &ActiveEventLoop,
event_loop: &ActiveEventLoop,
_: WindowId,
event: WindowEvent,
) {
@ -50,6 +50,9 @@ impl ApplicationHandler for App {
};
match event {
WindowEvent::CloseRequested => {
event_loop.exit();
}
WindowEvent::RedrawRequested => {
renderer.render();
}