1#![forbid(unsafe_code)]
4
5mod app;
6mod context;
7mod time;
8
9pub use app::{AppConfig, run};
10pub use context::{Context, GameEvent};
11pub use time::Time;
12
13pub trait Game: 'static + Sized {
14 fn init(ctx: &mut Context) -> anyhow::Result<Self>;
15 fn update(&mut self, ctx: &mut Context, dt: f32);
16 fn render(&mut self, ctx: &mut Context, frame: &mut game_toolkit_gfx::Frame);
17 fn event(&mut self, _ctx: &mut Context, _event: &GameEvent) {}
18 fn raw_window_event(&mut self, _ctx: &mut Context, _event: &winit::event::WindowEvent) -> bool {
22 false
23 }
24 fn shutdown(&mut self, _ctx: &mut Context) {}
25}