Skip to main content

EguiRunOutput

Struct EguiRunOutput 

Source
pub struct EguiRunOutput {
    pub shapes: Vec<ClippedShape>,
    pub pixels_per_point: f32,
    pub textures_delta: TexturesDelta,
    pub repaint_delay: Duration,
}
Expand description

The results of running one frame of egui.

EguiRunOutput collects the renderable shapes, texture updates, and scale factor from a single egui run. It also provides convenience methods for updating its contents from an egui::Context and for draining the data when it is time to render.

This is typically created once per backend instance and reused across frames.

Fields§

§shapes: Vec<ClippedShape>

The clipped shapes that should be rendered for the current frame.

This is produced by egui’s tessellation step and represents what should be drawn to the screen.

§pixels_per_point: f32

The logical-to-physical pixel scaling factor used by egui in this frame.

Backends should respect this when converting coordinates to pixels.

§textures_delta: TexturesDelta

The delta of texture updates required for this frame.

Includes new textures to upload and old textures to free.

§repaint_delay: Duration

How long until egui wants the ROOT viewport repainted, as reported by the last Self::update (egui’s ViewportOutput::repaint_delay).

Duration::ZERO means egui needs another frame immediately — e.g. the frame just run was a sizing pass for a freshly shown egui::Area, whose real (positioned, visible) frame must follow. Duration::MAX means egui is idle and the backend may block on input. Event-driven backends should fold this into their idle wait so animations and first-frame layout show without an extra input event.

Implementations§

Source§

impl EguiRunOutput

Source

pub fn update( &mut self, ctx: &Context, state: &mut State, run_ui: impl FnMut(&Context), )

Run egui for one frame and update this output with the results.

§Parameters
  • ctx: The egui::Context used to run the UI.
  • state: A backend state that provides input for egui and handles platform output (clipboard, cursor, etc.).
  • run_ui: A closure that builds the UI using the given egui::Context.
§Behavior
  • Takes input events from state.
  • Runs egui with the provided run_ui closure.
  • Handles platform output via state.
  • Stores the frame’s shapes, texture updates, and scale factor in this EguiRunOutput.
Source

pub fn take(&mut self) -> (TexturesDelta, Vec<ClippedShape>)

Take ownership of the texture updates and shapes for the current frame.

This clears both fields in the struct, leaving them empty for the next frame.

§Returns
  • (textures_delta, shapes) where:
    • textures_delta: The egui::TexturesDelta with texture uploads/free requests.
    • shapes: The tessellated shapes that should be rendered.

Trait Implementations§

Source§

impl Default for EguiRunOutput

Source§

fn default() -> Self

Creates an empty EguiRunOutput with no shapes, no texture updates, and a scale factor of 1.0.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.