Clarify documentation of window::frames

This commit is contained in:
Héctor Ramón Jiménez 2023-01-13 18:17:15 +01:00
parent c6d0046102
commit b9c8c7b08d
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -17,7 +17,11 @@ use crate::time::Instant;
/// Subscribes to the frames of the window of the running application.
///
/// The resulting [`Subscription`] will produce items at a rate equal to the
/// framerate of the monitor of said window.
/// refresh rate of the window. Note that this rate may be variable, as it is
/// normally managed by the graphics driver and/or the OS.
///
/// In any case, this [`Subscription`] is useful to smoothly draw application-driven
/// animations without missing any frames.
pub fn frames() -> Subscription<Instant> {
subscription::raw_events(|event, _status| match event {
crate::Event::Window(Event::RedrawRequested(at)) => Some(at),