Clarify documentation of window::frames
This commit is contained in:
parent
c6d0046102
commit
b9c8c7b08d
1 changed files with 5 additions and 1 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue