Update project

This commit is contained in:
Werner
2021-11-08 12:17:40 -03:00
parent c5dbf96177
commit 15e8989bef
30 changed files with 873 additions and 851 deletions

13
Source/State.rs Normal file
View File

@ -0,0 +1,13 @@
use crate::Display;
use anyhow::Result;
use std::time::Duration;
use winit::event::*;
/// Represents a application with reactive state.
pub trait State: Sized + 'static {
fn Init(display: &Display) -> Result<Self>;
fn Input(&mut self, display: &Display, event: &WindowEvent) -> bool;
fn Update(&mut self, display: &Display, delta: Duration);
fn Resize(&mut self, display: &Display);
fn Draw(&mut self, display: &mut Display) -> Result<(), wgpu::SurfaceError>;
}