pub struct EguiWindow { /* private fields */ }Expand description
egui and the window it draws into, over whichever renderer was available.
Vsync is on; every backend clears, paints and presents in Self::paint.
Implementations§
Source§impl EguiWindow
impl EguiWindow
Sourcepub fn new(
video: &VideoSubsystem,
title: &str,
size: (u32, u32),
configure: impl Fn(&mut WindowBuilder),
order: &[Renderer],
) -> Result<Self, String>
pub fn new( video: &VideoSubsystem, title: &str, size: (u32, u32), configure: impl Fn(&mut WindowBuilder), order: &[Renderer], ) -> Result<Self, String>
Try order in sequence, returning the first renderer that comes up.
The error is the last attempt’s, since that is the one that decided it.
Sourcepub fn set_rotation(&mut self, rotation: Rotation)
pub fn set_rotation(&mut self, rotation: Rotation)
Present the UI at a quarter turn to the window, for a panel that is not mounted the way it is read.
egui lays out for the turned screen — a quarter turn trades the window’s
width and height — and this window puts the frame back on the panel:
Renderer::Gles3 and Renderer::Gl32 turn the geometry as they draw
it, the SDL renderers paint offscreen and present that turned. Pointer
and touch positions travel back the same way, so a tap lands where it
looks. May be called at any time; nothing is rebuilt on a change of turn.
pub fn rotation(&self) -> Rotation
pub fn ctx(&self) -> &Context
pub fn window(&self) -> &Window
Sourcepub fn window_mut(&mut self) -> &mut Window
pub fn window_mut(&mut self) -> &mut Window
For the things SDL only does through the window itself, like
Window::set_icon.
Sourcepub fn on_event(&mut self, event: &Event) -> EventResponse
pub fn on_event(&mut self, event: &Event) -> EventResponse
Feed an SDL event to egui; wgpu also resizes its surface here.
Sourcepub fn run(&mut self, run_ui: impl FnMut(&Context))
pub fn run(&mut self, run_ui: impl FnMut(&Context))
Run the UI; Self::paint puts the result on screen.
Sourcepub fn repaint_delay(&self) -> Duration
pub fn repaint_delay(&self) -> Duration
How long until egui wants another frame, from the last Self::run.
Auto Trait Implementations§
impl !RefUnwindSafe for EguiWindow
impl !Send for EguiWindow
impl !Sync for EguiWindow
impl !UnwindSafe for EguiWindow
impl Freeze for EguiWindow
impl Unpin for EguiWindow
impl UnsafeUnpin for EguiWindow
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