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
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::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 givenegui::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
.
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::TexturesDelta
with texture uploads/free requests.shapes
: The tessellated shapes that should be rendered.