Struct three_d::GUI

source ·
pub struct GUI { /* private fields */ }
Available on crate feature egui-gui only.
Expand description

Integration of egui, an immediate mode GUI.

Implementations§

source§

impl GUI

source

pub fn new(context: &Context) -> Self

Creates a new GUI from a mid-level Context.

source

pub fn from_gl_context(context: Arc<Context>) -> Self

Creates a new GUI from a low-level graphics Context.

source

pub fn update( &mut self, events: &mut [Event], accumulated_time_in_ms: f64, viewport: Viewport, device_pixel_ratio: f32, callback: impl FnOnce(&Context) ) -> bool

Initialises a new frame of the GUI and handles events. Construct the GUI (Add panels, widgets etc.) using the egui::Context in the callback function. This function returns whether or not the GUI has changed, ie. if it consumes any events, and therefore needs to be rendered again.

source

pub fn render(&self)

Render the GUI defined in the update function. Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.

Auto Trait Implementations§

§

impl !RefUnwindSafe for GUI

§

impl Send for GUI

§

impl !Sync for GUI

§

impl Unpin for GUI

§

impl !UnwindSafe for GUI

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,