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: f32The logical-to-physical pixel scaling factor used by egui in this frame.
Backends should respect this when converting coordinates to pixels.
textures_delta: TexturesDeltaThe delta of texture updates required for this frame.
Includes new textures to upload and old textures to free.
repaint_delay: DurationHow 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
impl EguiRunOutput
Sourcepub fn update(
&mut self,
ctx: &Context,
state: &mut State,
run_ui: impl FnMut(&Context),
)
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: Theegui::Contextused 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 givenegui::Context.
§Behavior
- Takes input events from
state. - Runs egui with the provided
run_uiclosure. - Handles platform output via
state. - Stores the frame’s shapes, texture updates, and scale factor
in this
EguiRunOutput.
Sourcepub fn take(&mut self) -> (TexturesDelta, Vec<ClippedShape>)
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: Theegui::TexturesDeltawith texture uploads/free requests.shapes: The tessellated shapes that should be rendered.