From 69783445f1ef815cf4343471888667b9071b3443 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 10 Sep 2024 16:16:13 +0200 Subject: [PATCH 1/2] Change docs on WaitUntil to not suggest Poll --- src/event_loop.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/event_loop.rs b/src/event_loop.rs index edcac345f8..7d8420f0b5 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -148,11 +148,12 @@ pub enum ControlFlow { /// When the current loop iteration finishes, suspend the thread until either another event /// arrives or the given time is reached. /// - /// Useful for implementing efficient timers. Applications which want to render at the - /// display's native refresh rate should instead use [`Poll`] and the VSync functionality - /// of a graphics API to reduce odds of missed frames. + /// Useful for implementing efficient timers, but should not be relied on for real-time needs + /// like rendering (VSync) or audio. Applications which want to render at the display's native + /// refresh rate should instead issue a [`Window::request_redraw`] at the end of + /// [`WindowEvent::RedrawRequested`]. /// - /// [`Poll`]: Self::Poll + /// [`WindowEvent::RedrawRequested`]: crate::window::WindowEvent::RedrawRequested WaitUntil(Instant), } From f1754bf14fea8624820731ca1cd344199d173173 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 11 Sep 2024 10:15:42 +0200 Subject: [PATCH 2/2] Fix docs link --- src/event_loop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event_loop.rs b/src/event_loop.rs index 7d8420f0b5..6195724cdf 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -153,7 +153,7 @@ pub enum ControlFlow { /// refresh rate should instead issue a [`Window::request_redraw`] at the end of /// [`WindowEvent::RedrawRequested`]. /// - /// [`WindowEvent::RedrawRequested`]: crate::window::WindowEvent::RedrawRequested + /// [`WindowEvent::RedrawRequested`]: crate::event::WindowEvent::RedrawRequested WaitUntil(Instant), }