EguiRunOutput

Struct EguiRunOutput 

Source
pub struct EguiRunOutput {
    pub shapes: Vec<ClippedShape>,
    pub pixels_per_point: f32,
    pub textures_delta: TexturesDelta,
}
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.

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<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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, 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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,