1
0
Fork 0

[STATE] Update

This commit is contained in:
Florian RICHER 2022-06-21 21:09:59 +02:00
parent ebb5ac8fae
commit 2039b4b543
3 changed files with 37 additions and 101 deletions

View file

@ -1,4 +1,13 @@
mod renderer;
mod display;
pub use renderer::Renderer;
pub use renderer::Renderer;
use wgpu::{TextureView, CommandEncoder};
use winit::event::WindowEvent;
pub trait State {
fn new(renderer: &Renderer) -> Self where Self: Sized;
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>);
fn input(&mut self, event: &WindowEvent) -> bool;
fn update(&mut self, dt: instant::Duration);
fn render(&mut self, view: &TextureView, encoder: &mut CommandEncoder) -> Result<(), wgpu::SurfaceError>;
}