update to gfx 0.13

This commit is contained in:
2016-12-26 15:42:03 -08:00
parent 3a8c0148c8
commit b955d7f1b6
3 changed files with 23 additions and 19 deletions

View File

@@ -6,7 +6,8 @@ pub use self::vr::Eye;
pub use self::vr::common::Size;
pub use self::openvr_sys::VRControllerState_t;
use gfx::{self, tex, Factory, Typed};
use gfx::{self, texture, Factory};
use gfx::memory::Typed;
use na::{self, Inverse};
use num_traits::identities::Zero;
use num_traits::identities::One;
@@ -153,15 +154,15 @@ pub fn create_eyebuffer<T, D>(factory: &mut gfx_device_gl::Factory,
where T: gfx::format::RenderFormat + gfx::format::TextureFormat,
D: gfx::format::DepthFormat + gfx::format::TextureFormat {
let tex = factory
.create_texture(tex::Kind::D2(size.width as tex::Size,
size.height as tex::Size,
tex::AaMode::Single),
.create_texture(texture::Kind::D2(size.width as texture::Size,
size.height as texture::Size,
texture::AaMode::Single),
1, // levels
gfx::RENDER_TARGET, // bind
gfx::Usage::GpuOnly, // Usage
gfx::memory::Usage::GpuOnly, // Usage
Some(<T::Channel as gfx::format::ChannelTyped>::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)?;
let depth = factory.create_depth_stencil_view_only(size.width as texture::Size,
size.height as texture::Size)?;
Ok(EyeBuffer { tex: tex, target: tgt, depth: depth })
}