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 update_ui(
&mut self,
ctx: &Context,
state: &mut State,
run_ui: impl FnMut(&mut Ui),
)
pub fn update_ui( &mut self, ctx: &Context, state: &mut State, run_ui: impl FnMut(&mut Ui), )
Like Self::update, but hands the closure egui’s root egui::Ui.
Panels (egui::CentralPanel, [egui::TopBottomPanel], …) are shown into
a Ui, so a full-screen layout needs this rather than Self::update.
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.
Trait Implementations§
Source§impl Default for EguiRunOutput
impl Default for EguiRunOutput
Source§impl Drop for EguiRunOutput
impl Drop for EguiRunOutput
Auto Trait Implementations§
impl !RefUnwindSafe for EguiRunOutput
impl !UnwindSafe for EguiRunOutput
impl Freeze for EguiRunOutput
impl Send for EguiRunOutput
impl Sync for EguiRunOutput
impl Unpin for EguiRunOutput
impl UnsafeUnpin for EguiRunOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more