From 070688a84df8ce66bf14bbbba8bc6949a78162e0 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 17 Mar 2021 22:58:35 -0400 Subject: [PATCH] [rs] Schedule event waits after redraw events are cleared --- wgpu/examples/framework.rs | 2 +- wgpu/examples/hello-triangle/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wgpu/examples/framework.rs b/wgpu/examples/framework.rs index 17c19e06c9..29fa8140f5 100644 --- a/wgpu/examples/framework.rs +++ b/wgpu/examples/framework.rs @@ -221,7 +221,7 @@ fn start( 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 diff --git a/wgpu/examples/hello-triangle/main.rs b/wgpu/examples/hello-triangle/main.rs index 6ae9ea0f4e..db168a9ba3 100644 --- a/wgpu/examples/hello-triangle/main.rs +++ b/wgpu/examples/hello-triangle/main.rs @@ -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),