struggling with the borrow checker

This commit is contained in:
2019-07-06 16:12:39 -07:00
parent f903b741e0
commit 8c56bda87a
3 changed files with 80 additions and 53 deletions

View File

@@ -51,7 +51,10 @@ mod vkprocessor;
fn main() {
let processor = vkprocessor::VkProcessor::new();
let mut processor = vkprocessor::VkProcessor::new();
processor.compile_kernel();
processor.load_buffers();
let mut window = RenderWindow::new(
@@ -66,8 +69,9 @@ fn main() {
let font = Font::from_file("resources/fonts/sansation.ttf").unwrap();
let xy = processor.img.unwrap().dimensions();
let mut bg_texture = Texture::new(xy.0, xy.1).unwrap();
bg_texture.update_from_pixels(image_buffer.as_slice(), xy.0, xy.1, 0, 0);
bg_texture.update_from_pixels(processor.image_buffer.as_slice(), xy.0, xy.1, 0, 0);
let mut background_sprite = Sprite::with_texture(&bg_texture);
background_sprite.set_position((0., 0.));