wip: slowly putting it back together

This commit is contained in:
🪞👃🪞 2024-09-04 22:39:43 +03:00
parent 7fbb40fad6
commit 461c60d6b3
18 changed files with 788 additions and 774 deletions

View file

@ -0,0 +1,23 @@
use crate::*;
/// Entry point for main loop
pub trait App<T: Engine> {
fn run (self, context: T) -> Usually<T>;
}
/// Platform backend.
pub trait Engine {
type Handled;
type Rendered;
fn setup (&mut self) -> Usually<()> {
Ok(())
}
fn teardown (&mut self) -> Usually<()> {
Ok(())
}
fn handle (&self, _: &mut impl Handle<Self, Self::Handled>)
-> Usually<()> where Self: Sized;
fn render (&mut self, _: &impl Render<Self, Self::Rendered>)
-> Usually<()> where Self: Sized;
fn exited (&self) -> bool;
}