pub struct App { /* private fields */ }
Expand description
Main application struct.
Implementations§
source§impl App
impl App
sourcepub fn new(
settings: Option<Settings>,
config: Option<Config>
) -> Result<Self, CreationError>
pub fn new( settings: Option<Settings>, config: Option<Config> ) -> Result<Self, CreationError>
sourcepub fn main_monitor(&self) -> &Monitor
pub fn main_monitor(&self) -> &Monitor
Get the main monitor of the app.
sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether or not the app is running.
sourcepub fn set_update_callback<F>(&self, callback: F)where
F: FnMut() + 'static,
pub fn set_update_callback<F>(&self, callback: F)where
F: FnMut() + 'static,
Set a callback to be called whenever the App updates. You should update all app logic here.
This event is fired right before the run loop calls
Renderer::update
and
Renderer::render
.
sourcepub fn create_window(
&self,
width: u32,
height: u32,
fullscreen: bool,
window_flags: WindowFlags
) -> Option<Window>
pub fn create_window( &self, width: u32, height: u32, fullscreen: bool, window_flags: WindowFlags ) -> Option<Window>
Create a new window.
§Arguments
width
- The width of the window.height
- The height of the window.fullscreen
- Whether or not the window should be fullscreen.window_flags
- VariousWindowFlags
.
The window will be shown by default unless WindowFlags::hidden
was set.
The window will be closed automatically if the object is dropped.
Returns None
if the window could not be created.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for App
impl !Send for App
impl !Sync for App
impl Unpin for App
impl UnwindSafe for App
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