pub struct JugarEngine { /* private fields */ }Expand description
The main Jugar game engine
Implementations§
Source§impl JugarEngine
impl JugarEngine
Sourcepub fn new(config: JugarConfig) -> Self
pub fn new(config: JugarConfig) -> Self
Creates a new Jugar engine with the given configuration
Sourcepub const fn config(&self) -> &JugarConfig
pub const fn config(&self) -> &JugarConfig
Gets the configuration
Sourcepub fn viewport_mut(&mut self) -> &mut Viewport
pub fn viewport_mut(&mut self) -> &mut Viewport
Gets the viewport mutably
Sourcepub const fn input(&self) -> &InputState
pub const fn input(&self) -> &InputState
Gets the input state
Sourcepub fn input_mut(&mut self) -> &mut InputState
pub fn input_mut(&mut self) -> &mut InputState
Gets the input state mutably
Sourcepub const fn audio(&self) -> &AudioSystem
pub const fn audio(&self) -> &AudioSystem
Gets the audio system
Sourcepub fn audio_mut(&mut self) -> &mut AudioSystem
pub fn audio_mut(&mut self) -> &mut AudioSystem
Gets the audio system mutably
Sourcepub const fn physics(&self) -> &PhysicsWorld
pub const fn physics(&self) -> &PhysicsWorld
Gets the physics world
Sourcepub fn physics_mut(&mut self) -> &mut PhysicsWorld
pub fn physics_mut(&mut self) -> &mut PhysicsWorld
Gets the physics world mutably
Sourcepub const fn ui(&self) -> &UiContainer
pub const fn ui(&self) -> &UiContainer
Gets the UI container
Sourcepub fn ui_mut(&mut self) -> &mut UiContainer
pub fn ui_mut(&mut self) -> &mut UiContainer
Gets the UI container mutably
Sourcepub const fn is_running(&self) -> bool
pub const fn is_running(&self) -> bool
Checks if the engine is running
Sourcepub fn run<F>(&mut self, callback: F)where
F: FnMut(&mut Self) -> LoopControl,
pub fn run<F>(&mut self, callback: F)where
F: FnMut(&mut Self) -> LoopControl,
Runs the game loop with a callback
The callback receives a reference to the engine and returns LoopControl.
Trait Implementations§
Source§impl Debug for JugarEngine
impl Debug for JugarEngine
Auto Trait Implementations§
impl Freeze for JugarEngine
impl !RefUnwindSafe for JugarEngine
impl Send for JugarEngine
impl Sync for JugarEngine
impl Unpin for JugarEngine
impl !UnwindSafe for JugarEngine
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