diff --git a/src/vr.rs b/src/vr.rs index eb108fc..adb79bd 100644 --- a/src/vr.rs +++ b/src/vr.rs @@ -34,8 +34,8 @@ pub enum Event { impl VR { pub fn new() -> Result> { Ok(VR { - system: try!(vr::init()), - compositor: try!(vr::compositor()), + system: vr::init()?, + compositor: vr::compositor()?, gfx_handles: gfx::handle::Manager::new(), }) } @@ -154,14 +154,16 @@ pub fn create_eyebuffer(factory: &mut gfx_device_gl::Factory, -> Result, gfx::CombinedError> where T: gfx::format::RenderFormat + gfx::format::TextureFormat, D: gfx::format::DepthFormat + gfx::format::TextureFormat { - let tex = try!(factory.create_texture( - tex::Kind::D2(size.width as tex::Size, size.height as tex::Size, tex::AaMode::Single), - 1, // levels - gfx::RENDER_TARGET, // bind - gfx::Usage::GpuOnly, // Usage - Some(::get_channel_type()))); // hint: format::ChannelType? - let tgt = try!(factory.view_texture_as_render_target(&tex, 0, None)); - let depth = try!(factory.create_depth_stencil_view_only(size.width as tex::Size, - size.height as tex::Size)); + let tex = factory + .create_texture(tex::Kind::D2(size.width as tex::Size, + size.height as tex::Size, + tex::AaMode::Single), + 1, // levels + gfx::RENDER_TARGET, // bind + gfx::Usage::GpuOnly, // Usage + Some(::get_channel_type()))?; // hint: format::ChannelType? + let tgt = factory.view_texture_as_render_target(&tex, 0, None)?; + let depth = factory.create_depth_stencil_view_only(size.width as tex::Size, + size.height as tex::Size)?; Ok(EyeBuffer { tex: tex, target: tgt, depth: depth }) }