[rs] Schedule event waits after redraw events are cleared

This commit is contained in:
Dzmitry Malyshau 2021-03-17 22:58:35 -04:00
parent 0542ad585a
commit 070688a84d
2 changed files with 2 additions and 2 deletions

View File

@ -221,7 +221,7 @@ fn start<E: Example>(
ControlFlow::Poll
};
match event {
event::Event::MainEventsCleared => {
event::Event::RedrawEventsCleared => {
#[cfg(not(target_arch = "wasm32"))]
{
// Clamp to some max framerate to avoid busy-looping too much

View File

@ -80,7 +80,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
// the resources are properly cleaned up.
let _ = (&instance, &adapter, &shader, &pipeline_layout);
*control_flow = ControlFlow::Poll;
*control_flow = ControlFlow::Wait;
match event {
Event::WindowEvent {
event: WindowEvent::Resized(size),