pub struct Context { /* private fields */ }
Expand description
The main ImGui context.
Implementations§
Source§impl Context
impl Context
Sourcepub unsafe fn new() -> Context
pub unsafe fn new() -> Context
Creates a new ImGui context with default values.
SAFETY: It is unsafe because it makes the context current, and that may brake the current context if called at the wrong time.
Sourcepub unsafe fn set_size(&mut self, size: Vector2, scale: f32)
pub unsafe fn set_size(&mut self, size: Vector2, scale: f32)
Sets the size and scale of the context area.
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 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
.
Methods from Deref<Target = RawContext>§
Sourcepub fn get(&self) -> &ImGuiContext
pub fn get(&self) -> &ImGuiContext
Gets a reference to the native wrapper struct.
Sourcepub unsafe fn inner(&mut self) -> &mut ImGuiContext
pub unsafe fn inner(&mut self) -> &mut ImGuiContext
Gets a reference to the actual DearImGui context struct.
Sourcepub fn platform_io(&self) -> &PlatformIo
pub fn platform_io(&self) -> &PlatformIo
Returns a safe wrapper for the PlatformIo
.
Sourcepub unsafe fn platform_io_mut(&mut self) -> &mut PlatformIo
pub unsafe fn platform_io_mut(&mut self) -> &mut PlatformIo
Returns an unsafe mutable wrapper for the PlatformIo
.
Sourcepub fn io_mut(&mut self) -> &mut IoMut
pub fn io_mut(&mut self) -> &mut IoMut
Returns a safe mutable wrapper for the IO.
Use io_mut().inner()
to get the unsafe wrapper
Sourcepub fn get_main_viewport(&self) -> &Viewport
pub fn get_main_viewport(&self) -> &Viewport
Gets a reference to the main viewport