pub struct Engine<WORLD, E> {
pub target_frame_rate: u32,
pub world: Arc<RwLock<WORLD>>,
/* private fields */
}
Expand description
Re-export of Nate’s Engine Core The basic Engine schedules systems to run at given time intervals in a a threadpool with a singular thread reserved for UI rendering at a given frame rate
Fields§
§target_frame_rate: u32
§world: Arc<RwLock<WORLD>>
Implementations§
Source§impl<WORLD, E> Engine<WORLD, E>
impl<WORLD, E> Engine<WORLD, E>
Sourcepub fn new(
frame_rate: u32,
workers: usize,
world: Arc<RwLock<WORLD>>,
systems: Vec<(fn(Arc<RwLock<WORLD>>), u128)>,
renderer: Box<dyn Renderer<WORLD, Error = E>>,
) -> Engine<WORLD, E>
pub fn new( frame_rate: u32, workers: usize, world: Arc<RwLock<WORLD>>, systems: Vec<(fn(Arc<RwLock<WORLD>>), u128)>, renderer: Box<dyn Renderer<WORLD, Error = E>>, ) -> Engine<WORLD, E>
Create a new engine with workers, a target frame rate, a world, and the systems to act on the world (and their update rate (in us))
Auto Trait Implementations§
impl<WORLD, E> Freeze for Engine<WORLD, E>
impl<WORLD, E> !RefUnwindSafe for Engine<WORLD, E>
impl<WORLD, E> Send for Engine<WORLD, E>
impl<WORLD, E> Sync for Engine<WORLD, E>
impl<WORLD, E> Unpin for Engine<WORLD, E>
impl<WORLD, E> !UnwindSafe for Engine<WORLD, E>
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