Use RedrawRequested
- THis will likely change after https://github.com/rust-windowing/winit/issues/1082 lands
This commit is contained in:
parent
2ec303812f
commit
5519aafd18
|
@ -6,7 +6,7 @@ fn main() -> Result<(), Error> {
|
|||
env_logger::init();
|
||||
let event_loop = EventLoop::new();
|
||||
|
||||
let (_window, surface) = {
|
||||
let (window, surface) = {
|
||||
let window = winit::window::Window::new(&event_loop).unwrap();
|
||||
let surface = wgpu::Surface::create(&window);
|
||||
|
||||
|
@ -26,14 +26,11 @@ fn main() -> Result<(), Error> {
|
|||
},
|
||||
..
|
||||
}
|
||||
| event::WindowEvent::CloseRequested => {
|
||||
*control_flow = ControlFlow::Exit;
|
||||
}
|
||||
_ => {}
|
||||
| event::WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit,
|
||||
event::WindowEvent::RedrawRequested => fb.render(),
|
||||
_ => (),
|
||||
},
|
||||
event::Event::EventsCleared => {
|
||||
fb.render();
|
||||
}
|
||||
event::Event::EventsCleared => window.request_redraw(),
|
||||
_ => (),
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue