pub struct PlutoniumApp { /* private fields */ }Expand description
PlutoniumApp data.
Implementations§
Source§impl PlutoniumApp
impl PlutoniumApp
Sourcepub fn new<F>(config: WindowConfig, frame_callback: F) -> Self
pub fn new<F>(config: WindowConfig, frame_callback: F) -> Self
Creates a new value.
Sourcepub fn engine(&mut self) -> Option<&mut PlutoniumEngine<'static>>
pub fn engine(&mut self) -> Option<&mut PlutoniumEngine<'static>>
Engine.
Sourcepub fn set_fixed_timestep(&mut self, dt_seconds: f32)
pub fn set_fixed_timestep(&mut self, dt_seconds: f32)
Set a fixed timestep for the frame callback (e.g., 1.0/60.0).
When set, FrameContext.delta_time uses this value each frame.
Sourcepub fn clear_fixed_timestep(&mut self)
pub fn clear_fixed_timestep(&mut self)
Disable fixed timestep; FrameContext.delta_time will be real time.
Sourcepub fn start_recording(&mut self, path: impl Into<String>)
pub fn start_recording(&mut self, path: impl Into<String>)
Starts recording.
Sourcepub fn start_replay(&mut self, path: &str) -> Result<(), Box<dyn Error>>
pub fn start_replay(&mut self, path: &str) -> Result<(), Box<dyn Error>>
Starts replay.
Replay restores mouse buttons, cursor position, scroll, committed text,
and frame timing from the recording. Logical key events are intentionally
not reconstructed from their serialized debug names, so
FrameContext::pressed_keys is empty during replay frames.
Sourcepub fn stop_replay(&mut self)
pub fn stop_replay(&mut self)
Stops replay.
Sourcepub fn set_fullscreen(&mut self, fullscreen: bool)
pub fn set_fullscreen(&mut self, fullscreen: bool)
Toggle or set fullscreen mode. On macOS, this uses exclusive fullscreen which works well with the green button. On other platforms, uses borderless fullscreen. The green button on macOS will trigger native fullscreen which is handled by the OS.
Sourcepub fn toggle_fullscreen(&mut self)
pub fn toggle_fullscreen(&mut self)
Toggle fullscreen mode
Sourcepub fn is_fullscreen(&self) -> bool
pub fn is_fullscreen(&self) -> bool
Check if window is currently in fullscreen mode
Sourcepub fn is_key_down(&self, key: &Key) -> bool
pub fn is_key_down(&self, key: &Key) -> bool
Returns true when the given winit logical key is currently held down.
This low-level helper is for manual integrations that already consume
winit; frame callbacks should prefer FrameContext::pressed_keys.
Sourcepub fn is_char_key_down(&self, ch: char) -> bool
pub fn is_char_key_down(&self, ch: char) -> bool
Returns true when a character key (case-insensitive) is currently held down.
Sourcepub fn is_named_key_down(&self, named: NamedKey) -> bool
pub fn is_named_key_down(&self, named: NamedKey) -> bool
Returns true when a named key is currently held down.
Trait Implementations§
Source§impl ApplicationHandler for PlutoniumApp
impl ApplicationHandler for PlutoniumApp
Source§fn resumed(&mut self, event_loop: &ActiveEventLoop)
fn resumed(&mut self, event_loop: &ActiveEventLoop)
Source§fn window_event(
&mut self,
event_loop: &ActiveEventLoop,
_window_id: WindowId,
event: WindowEvent,
)
fn window_event( &mut self, event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent, )
Source§fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop)
fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop)
Source§fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
Source§fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)
fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)
EventLoopProxy::send_event.Source§fn device_event(
&mut self,
event_loop: &ActiveEventLoop,
device_id: DeviceId,
event: DeviceEvent,
)
fn device_event( &mut self, event_loop: &ActiveEventLoop, device_id: DeviceId, event: DeviceEvent, )
Source§fn suspended(&mut self, event_loop: &ActiveEventLoop)
fn suspended(&mut self, event_loop: &ActiveEventLoop)
Source§fn exiting(&mut self, event_loop: &ActiveEventLoop)
fn exiting(&mut self, event_loop: &ActiveEventLoop)
Source§fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
Auto Trait Implementations§
impl !Freeze for PlutoniumApp
impl !RefUnwindSafe for PlutoniumApp
impl !Send for PlutoniumApp
impl !Sync for PlutoniumApp
impl !UnwindSafe for PlutoniumApp
impl Unpin for PlutoniumApp
impl UnsafeUnpin for PlutoniumApp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more