pub struct FrameOutput {
    pub exit: bool,
    pub swap_buffers: bool,
    pub screenshot: Option<PathBuf>,
    pub wait_next_event: bool,
}
Expand description

Output from the rendering to the window each frame.

Fields

exit: bool

If this is true:

  • On desktop, the window is closed and the renderloop is stopped.
  • On web, the render loop is stopped, the event handlers are removed and the Window dropped. Note that the canvas is not removed.
swap_buffers: bool

Swaps the back and front buffer if this is true. Set this to true if something have been rendered this frame and you want to display it. Set it to false if nothing have been rendered this frame, for example if nothing has changed, and you want to reuse the image from an old frame. Currently ignored on web, since it does not use double buffering.

screenshot: Option<PathBuf>
Available on crate feature image-io only.

Takes a screenshot if this is set to some path and saves it at the given location. Only works on desktop and if the image-io feature is enabled.

wait_next_event: bool

Whether to stop the render loop until next event.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more