[−][src]Struct screen_13::Engine
Pumps an operating system event loop in order to refresh a Gpu
-created image at the refresh
rate of the monitor. Requires a DynScreen
instance to render.
Implementations
impl Engine
[src]
pub fn new<'a, 'b, P: AsRef<Program<'a, 'b>>>(program: P) -> Self
[src]
Constructs a new Engine
from the given Program
description.
NOTE: This function loads any existing user configuration file and may override program description options in order to preserve the user experience.
Examples
use screen_13::prelude_all::*; fn main() { let foo = Program::new("UltraMega III", "Nintari, Inc.") .with_title("UltraMega III: Breath of Fire") .with_window(); let engine = Engine::new(foo); // We ask for windowed mode, but we ... engine.run(...) // <- ... get fullscreen because of some previous run. 😂 }
pub fn gpu(&self) -> &Gpu
[src]
Borrows the Gpu
instance.
pub fn run(self, screen: DynScreen) -> !
[src]
Runs a program starting with the given DynScreen
.
Immediately after this call, draw
will be called on the screen, followed by update
, ad
infinium. This call does not return to the calling code.
Examples
use screen_13::prelude_all::*; fn main() { let engine = Engine::default(); engine.run(Box::new(FooScreen)) // <- Note the return value which is the no-return bang // "value", inception. 🤯 } struct FooScreen; impl Screen for FooScreen { ... }
Trait Implementations
impl Default for Engine
[src]
impl From<&'_ Program<'_, '_>> for Engine
[src]
impl From<Program<'_, '_>> for Engine
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Engine
[src]
impl !Send for Engine
[src]
impl !Sync for Engine
[src]
impl Unpin for Engine
[src]
impl !UnwindSafe for Engine
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,