minor cleanup

This commit is contained in:
Brandon Thomas
2020-04-06 01:54:31 -04:00
parent b807346714
commit 0107483c82
2 changed files with 6 additions and 20 deletions
+2 -2
View File
@@ -35,8 +35,8 @@ use k4a_sys_wrapper::Device;
use k4a_sys_wrapper::device_get_installed_count;
use k4a_sys_wrapper::Image;
/// We can't send trait 'Texture2dDataSource' impl 'RawImage2d' as it requires data lives
/// So here we collect it together.
/// We can't send trait 'Texture2dDataSource' impl 'RawImage2d' as it requires its data has
/// the same lifetime, so here we collect it together here.
pub struct TextureData2d<'a> {
pub raw_data: Vec<u8>,
pub dimensions: (u32, u32),
+4 -18
View File
@@ -55,9 +55,8 @@ pub mod handwritten_wrapper_test;
pub mod k4a_sys_wrapper;
pub mod sensors;
pub struct TextureContainer<'a> {
pub texture_data: Option<TextureData2d<'a>>,
pub texture: Option<Texture2d>
pub struct TextureContainer {
pub texture: Texture2d
}
pub fn main() {
@@ -189,8 +188,7 @@ pub fn main() {
let texture = glium::texture::Texture2d::new(&display, tex_data.raw_image).unwrap();
texture_container = Some(TextureContainer{
texture_data: None,
texture: Some(texture),
texture,
})
},
}
@@ -198,21 +196,9 @@ pub fn main() {
Err(_) => {},
}
let mut texture_2d: Option<Texture2d> = None;
/*match texture_data_2d {
Some(image) => {
/*let frame_image = image.to_rgba();
let frame_dimensions = frame_image.dimensions();
let frame_image = glium::texture::RawImage2d::from_raw_rgba_reversed(&frame_image.into_raw(), frame_dimensions);*/
//texture_2d = Some(glium::texture::Texture2d::new(&display, image.raw_image).unwrap());
},
None => {},
}*/
let texture_to_use: &Texture2d = texture_container
.as_ref()
.and_then(|c| c.texture.as_ref())
.map(|c| &c.texture)
.unwrap_or(&textureB);
let uniforms = uniform! {