pub struct CurrentContext<'a> { /* private fields */ }
Expand description
A context that we are sure is made current.
Implementations§
Source§impl CurrentContext<'_>
impl CurrentContext<'_>
Sourcepub unsafe fn do_frame<A: UiBuilder>(
&mut self,
app: &mut A,
pre_render: impl FnOnce(&mut Self),
render: impl FnOnce(&ImDrawData),
)
pub unsafe fn do_frame<A: UiBuilder>( &mut self, app: &mut A, pre_render: impl FnOnce(&mut Self), 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 = 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
Methods from Deref<Target = ImGuiContext>§
pub fn ActiveIdMouseButton(&self) -> i32
Trait Implementations§
Source§impl Deref for CurrentContext<'_>
impl Deref for CurrentContext<'_>
Source§type Target = RawContext
type Target = RawContext
The resulting type after dereferencing.
Source§fn deref(&self) -> &RawContext
fn deref(&self) -> &RawContext
Dereferences the value.
Source§impl DerefMut for CurrentContext<'_>
impl DerefMut for CurrentContext<'_>
Source§fn deref_mut(&mut self) -> &mut RawContext
fn deref_mut(&mut self) -> &mut RawContext
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> 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