1
0
Fork 0
This commit is contained in:
Florian RICHER 2022-06-16 23:41:44 +02:00
parent c2a32a3be6
commit 5e22cf2310
2 changed files with 11 additions and 0 deletions

View file

@ -19,6 +19,8 @@ pub use mesh::Mesh;
mod window;
pub use window::Window;
mod pipelines;
pub trait Renderable {
fn initialize(&mut self, device: &Device);
fn update_instances(&mut self, queue: &Queue);

View file

@ -0,0 +1,9 @@
use wgpu::{Device, Queue};
use super::Renderable;
pub trait Processable {
fn initialize(&mut self, device: &Device, queue: &Queue, renderable_entities: Vec<Box<dyn Renderable>>);
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>, renderable_entities: Vec<Box<dyn Renderable>>);
fn render(&mut self, renderable_entities: Vec<Box<dyn Renderable>>) -> Result<(), wgpu::SurfaceError>;
}