send events to scene

This commit is contained in:
2016-09-30 14:15:24 -07:00
parent 235b5d58bd
commit 0b8db8d9b4
4 changed files with 16 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
use view;
use vr;
extern crate gfx;
extern crate gfx_device_gl;
@@ -6,6 +7,7 @@ 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);
fn render(&self,
factory: &mut F,
@@ -14,3 +16,8 @@ pub trait Scene<D: gfx::Device,
target: &gfx::handle::RenderTargetView<D::Resources, view::ColorFormat>,
depth: &gfx::handle::DepthStencilView<D::Resources, view::DepthFormat>);
}
pub enum Event {
Vr(vr::Event),
Piston(piston_window::Input),
}