view doesn't own scene

This commit is contained in:
2016-09-30 13:37:44 -07:00
parent 7a9f65115c
commit 235b5d58bd
4 changed files with 23 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
extern crate vrtue;
use vrtue::{view, vr};
use vrtue::{scenes, view, vr};
use vrtue::scene::Scene;
extern crate env_logger;
extern crate gfx_device_gl;
@@ -18,14 +19,15 @@ pub fn main() {
.vsync(false)
.build().expect("Building Window");
let view = view::ViewRoot::<gfx_device_gl::Device,
view::ColorFormat,
view::DepthFormat>::create_view(&mut window, &mut vr);
let mut scene = scenes::world::WorldScene::new(&mut window.factory);
let view = view::ViewRoot::<gfx_device_gl::Device, view::ColorFormat, view::DepthFormat>
::create_view(&mut window, &mut vr);
'main:
//while let Some(_) = window.next() {
loop {
view.draw(&mut window, &mut vr);
scene.update();
view.draw(&mut window, &mut vr, &scene);
// handle window events
while let Some(ev) = window.poll_event() {