Struct egui_winit_platform::Platform[][src]

pub struct Platform { /* fields omitted */ }

Provides the integration between egui and winit.

Implementations

impl Platform[src]

pub fn new(descriptor: PlatformDescriptor) -> Self[src]

Creates a new Platform.

pub fn handle_event<T>(&mut self, winit_event: &Event<'_, T>)[src]

Handles the given winit event and updates the egui context. Should be called before starting a new frame with start_frame().

pub fn captures_event<T>(&self, winit_event: &Event<'_, T>) -> bool[src]

Returns true if egui should handle the event exclusively. Check this to avoid unexpected interactions, e.g. a mouse click registering “behind” the UI.

pub fn update_time(&mut self, elapsed_seconds: f64)[src]

Updates the internal time for egui used for animations. elapsed_seconds should be the seconds since some point in time (for example application start).

pub fn begin_frame(&mut self)[src]

Starts a new frame by providing a new Ui instance to write into.

pub fn end_frame(&mut self) -> (Output, Vec<ClippedShape>)[src]

Ends the frame. Returns what has happened as Output and gives you the draw instructions as PaintJobs.

pub fn context(&self) -> CtxRef[src]

Returns the internal egui context.

Auto Trait Implementations

impl !RefUnwindSafe for Platform

impl Send for Platform

impl Sync for Platform

impl Unpin for Platform

impl !UnwindSafe for Platform

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.