pub struct CurrentContext<'a> { /* private fields */ }
Implementations§
Source§impl CurrentContext<'_>
impl CurrentContext<'_>
pub fn set_allow_user_scaling(&mut self, val: bool)
pub fn want_capture_mouse(&self) -> bool
pub fn want_capture_keyboard(&self) -> bool
pub fn want_text_input(&self) -> bool
pub fn io(&self) -> &ImGuiIO
pub fn io_mut(&mut self) -> &mut ImGuiIO
pub fn platform_io(&self) -> &ImGuiPlatformIO
pub fn platform_io_mut(&mut self) -> &mut ImGuiPlatformIO
pub unsafe fn add_config_flags(&mut self, flags: ConfigFlags)
pub unsafe fn remove_config_flags(&mut self, flags: ConfigFlags)
pub unsafe fn set_size(&mut self, size: Vector2, scale: f32)
pub unsafe fn size(&self) -> Vector2
pub unsafe fn scale(&self) -> f32
pub unsafe fn update_atlas<'ui, A: UiBuilder>( &'ui mut self, app: &mut A, ) -> bool
Sourcepub unsafe fn do_frame<A: UiBuilder>(
&mut self,
app: &mut A,
pre_render: impl FnOnce(),
render: impl FnOnce(&ImDrawData),
)
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 afterapp.do_ui
but before rendering.render
: function to do the actual render.
Methods from Deref<Target = Context>§
Sourcepub unsafe fn set_current(&mut self) -> CurrentContext<'_>
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.
Sourcepub fn invalidate_font_atlas(&mut self)
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
.
Sourcepub fn set_ini_file_name(&mut self, ini_file_name: Option<&str>)
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.
Sourcepub fn ini_file_name(&self) -> Option<&str>
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<'_>
impl Deref for CurrentContext<'_>
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> 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
Mutably borrows from an owned value. Read more