Struct eframe::CreationContext

source ·
pub struct CreationContext<'s> {
    pub egui_ctx: Context,
    pub integration_info: IntegrationInfo,
    pub storage: Option<&'s dyn Storage>,
    pub gl: Option<Arc<Context>>,
    pub get_proc_address: Option<&'s dyn Fn(&CStr) -> *const c_void>,
    pub wgpu_render_state: Option<RenderState>,
}
Expand description

Data that is passed to AppCreator that can be used to setup and initialize your app.

Fields§

§egui_ctx: Context

The egui Context.

You can use this to customize the look of egui, e.g to call egui::Context::set_fonts, egui::Context::set_visuals etc.

§integration_info: IntegrationInfo

Information about the surrounding environment.

§storage: Option<&'s dyn Storage>

You can use the storage to restore app state(requires the “persistence” feature).

§gl: Option<Arc<Context>>

The glow::Context allows you to initialize OpenGL resources (e.g. shaders) that you might want to use later from a egui::PaintCallback.

Only available when compiling with the glow feature and using Renderer::Glow.

§get_proc_address: Option<&'s dyn Fn(&CStr) -> *const c_void>

The get_proc_address wrapper of underlying GL context

§wgpu_render_state: Option<RenderState>

The underlying WGPU render state.

Only available when compiling with the wgpu feature and using Renderer::Wgpu.

Can be used to manage GPU resources for custom rendering with WGPU using egui::PaintCallbacks.

Auto Trait Implementations§

§

impl<'s> Freeze for CreationContext<'s>

§

impl<'s> !RefUnwindSafe for CreationContext<'s>

§

impl<'s> !Send for CreationContext<'s>

§

impl<'s> !Sync for CreationContext<'s>

§

impl<'s> Unpin for CreationContext<'s>

§

impl<'s> !UnwindSafe for CreationContext<'s>

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.