29 lines
872 B
Rust
29 lines
872 B
Rust
use view;
|
|
use vr;
|
|
|
|
extern crate gfx;
|
|
extern crate gfx_device_gl;
|
|
extern crate nalgebra as na;
|
|
extern crate piston_window;
|
|
|
|
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>;
|
|
}
|
|
|
|
pub enum Event {
|
|
Vr(vr::Event),
|
|
Piston(piston_window::Input),
|
|
}
|