28 lines
840 B
Rust
28 lines
840 B
Rust
use gfx;
|
|
use na;
|
|
use piston;
|
|
use view;
|
|
use vr;
|
|
|
|
pub trait Scene<D: gfx::Device,
|
|
F: gfx::Factory<D::Resources>> {
|
|
fn event(&mut self, event: Event);
|
|
fn update(&mut self,
|
|
vr: &mut Option<vr::VR>, // TODO: abstract this out
|
|
encoder: &mut gfx::Encoder<D::Resources, D::CommandBuffer>);
|
|
fn render(&self,
|
|
factory: &mut F,
|
|
encoder: &mut gfx::Encoder<D::Resources, D::CommandBuffer>,
|
|
trans: &gfx::handle::Buffer<D::Resources, view::Trans>,
|
|
target: &gfx::handle::RenderTargetView<D::Resources, view::ColorFormat>,
|
|
depth: &gfx::handle::DepthStencilView<D::Resources, view::DepthFormat>);
|
|
|
|
fn origin(&self) -> na::Matrix4<f32>;
|
|
fn mouselook(&self) -> na::Matrix4<f32>;
|
|
}
|
|
|
|
pub enum Event {
|
|
Vr(vr::Event),
|
|
Piston(piston::input::Input),
|
|
}
|