Struct CurrentContext

Source
pub struct CurrentContext<'a> { /* private fields */ }

Implementations§

Source§

impl CurrentContext<'_>

Source

pub fn style(&mut self) -> &mut Style

Source§

impl CurrentContext<'_>

Source

pub fn set_allow_user_scaling(&mut self, val: bool)

Source

pub fn want_capture_mouse(&self) -> bool

Source

pub fn want_capture_keyboard(&self) -> bool

Source

pub fn want_text_input(&self) -> bool

Source

pub fn io(&self) -> &ImGuiIO

Source

pub fn io_mut(&mut self) -> &mut ImGuiIO

Source

pub fn platform_io(&self) -> &ImGuiPlatformIO

Source

pub fn platform_io_mut(&mut self) -> &mut ImGuiPlatformIO

Source

pub unsafe fn add_config_flags(&mut self, flags: ConfigFlags)

Source

pub unsafe fn remove_config_flags(&mut self, flags: ConfigFlags)

Source

pub fn nav_enable_keyboard(&mut self)

Source

pub fn nav_enable_gamepad(&mut self)

Source

pub unsafe fn set_size(&mut self, size: Vector2, scale: f32)

Source

pub unsafe fn size(&self) -> Vector2

Source

pub unsafe fn scale(&self) -> f32

Source

pub unsafe fn update_atlas<'ui, A: UiBuilder>( &'ui mut self, app: &mut A, ) -> bool

Source

pub unsafe fn do_frame<A: UiBuilder>( &mut self, app: &mut A, pre_render: impl FnOnce(), render: impl FnOnce(&ImDrawData), )

Builds and renders a UI frame.

  • app: UiBuilder to be used to build the frame.
  • re_render: function to be called after app.do_ui but before rendering.
  • render: function to do the actual render.

Methods from Deref<Target = Context>§

Source

pub unsafe fn set_current(&mut self) -> CurrentContext<'_>

Makes this context the current one.

SAFETY: Do not make two different contexts current at the same time in the same thread.

Source

pub fn invalidate_font_atlas(&mut self)

The next time CurrentContext::do_frame() is called, it will trigger a call to UiBuilder::build_custom_atlas.

Source

pub fn set_ini_file_name(&mut self, ini_file_name: Option<&str>)

Sets the ini file where ImGui persists its data.

By default is None, that means no file is saved.

Source

pub fn ini_file_name(&self) -> Option<&str>

Gets the ini file set previously by set_ini_file_name.

Trait Implementations§

Source§

impl Deref for CurrentContext<'_>

Source§

type Target = Context

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for CurrentContext<'_>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a> Freeze for CurrentContext<'a>

§

impl<'a> !RefUnwindSafe for CurrentContext<'a>

§

impl<'a> !Send for CurrentContext<'a>

§

impl<'a> !Sync for CurrentContext<'a>

§

impl<'a> Unpin for CurrentContext<'a>

§

impl<'a> !UnwindSafe for CurrentContext<'a>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

Source§

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.