Struct nannou::app::App
[−]
[src]
pub struct App { pub audio: Audio, // some fields omitted }
An App represents the entire context of your application.
The App owns and manages:
- the event loop (used to drive the application forward)
- all OpenGL windows (for graphics and user input, can be referenced via IDs).
Fields
audio: Audio
Audio-related functionality.
Methods
impl App
[src]
const ASSETS_DIRECTORY_NAME: &'static str
ASSETS_DIRECTORY_NAME: &'static str = "assets"
const DEFAULT_EXIT_ON_ESCAPE: bool
DEFAULT_EXIT_ON_ESCAPE: bool = true
fn assets_path(&self) -> Result<PathBuf, Error>
[src]
Find and return the absolute path to the project's assets
directory.
This method looks for the assets directory in the following order:
- Checks the same directory as the executable.
- Recursively checks exe's parent directories (to a max depth of 5).
- Recursively checks exe's children directories (to a max depth of 3).
fn new_window<'a>(&'a self) -> Builder<'a, 'static>
[src]
Begin building a new OpenGL window.
fn window_count(&self) -> usize
[src]
The number of windows currently in the application.
fn window(&self, id: Id) -> Option<Ref<Window>>
[src]
A reference to the window with the given Id
.
fn exit_on_escape(&self) -> bool
[src]
Return whether or not the App
is currently set to exit when the Escape
key is pressed.
fn set_exit_on_escape(&self, b: bool)
[src]
Specify whether or not the app should close when the Escape
key is pressed.
By default this is true
.
fn loop_mode(&self) -> LoopMode
[src]
Returns the App's current LoopMode.
fn set_loop_mode(&self, mode: LoopMode)
[src]
Sets the loop mode of the App.
Note: Setting the loop mode will not affect anything until the end of the current loop iteration. The behaviour of a single loop iteration is described under each of the LoopMode variants.
fn create_proxy(&self) -> Proxy
[src]
A handle to the App that can be shared across threads.
This can be used to "wake up" the App's inner event loop.
fn new_ui(&self, window_id: Id) -> Builder
[src]
Create a new Ui
for the window with the given Id
.
Returns None
if there is no window for the given window_id
.