pub struct MainWindowWithRenderer { /* private fields */ }Expand description
This is a MainWindow plus a Renderer. It is the ultimate easy-imgui object.
Instead of a literal MainWindow you can use any type that implements MainWindowRef.
Implementations§
source§impl MainWindowWithRenderer
impl MainWindowWithRenderer
sourcepub fn new(main_window: MainWindow) -> Self
pub fn new(main_window: MainWindow) -> Self
Creates a new Renderer and attaches it to the given window.
sourcepub fn set_idle_time(&mut self, time: Duration)
pub fn set_idle_time(&mut self, time: Duration)
Sets the time after which the UI will stop rendering, if there is no user input.
sourcepub fn set_idle_frame_count(&mut self, frame_count: u32)
pub fn set_idle_frame_count(&mut self, frame_count: u32)
Sets the frame count after which the UI will stop rendering, if there is no user input.
Note that by default V-Sync is enabled, and that will affect the frame rate.
sourcepub fn ping_user_input(&mut self)
pub fn ping_user_input(&mut self)
Forces a rebuild of the UI.
By default the window will stop rendering the UI after a while without user input. Use this function to force a redraw because of some external factor.
sourcepub fn main_window(&mut self) -> &mut MainWindow
pub fn main_window(&mut self) -> &mut MainWindow
Gets a reference to the inner window.
sourcepub fn new_with_renderer(main_window: MainWindow, renderer: Renderer) -> Self
pub fn new_with_renderer(main_window: MainWindow, renderer: Renderer) -> Self
Attaches the given window and renderer together.
sourcepub fn do_event<EventUserType>(
&mut self,
app: &mut impl UiBuilder,
event: &Event<EventUserType>,
) -> EventResult
pub fn do_event<EventUserType>( &mut self, app: &mut impl UiBuilder, event: &Event<EventUserType>, ) -> EventResult
The main event function, to be called from your event loop.
It returns EventResult. You can use it to break the main loop, or ignore it, as you see fit.
It also informs of whether ImGui want the monopoly of the user input.
sourcepub fn do_event_with_flags<EventUserType>(
&mut self,
app: &mut impl UiBuilder,
event: &Event<EventUserType>,
flags: EventFlags,
) -> EventResult
pub fn do_event_with_flags<EventUserType>( &mut self, app: &mut impl UiBuilder, event: &Event<EventUserType>, flags: EventFlags, ) -> EventResult
Just like do_event but with flags.
Auto Trait Implementations§
impl Freeze for MainWindowWithRenderer
impl !RefUnwindSafe for MainWindowWithRenderer
impl !Send for MainWindowWithRenderer
impl !Sync for MainWindowWithRenderer
impl Unpin for MainWindowWithRenderer
impl !UnwindSafe for MainWindowWithRenderer
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.