diff --git a/src/canvas.rs b/src/canvas.rs index 442cd43b..dcec91bf 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -279,11 +279,11 @@ impl Canvas { ).unwrap().0 ); - for (k, v) in self.textured_drawables.iter() { + for (k, v) in self.textured_drawables.drain() { self.textured_vertex_buffer.insert( k.clone(), ImmutableBuffer::from_iter( - self.textured_drawables.get(k).iter().cloned(), + v.iter().cloned(), BufferUsage::vertex_buffer(), self.queue.clone(), ).unwrap().0 @@ -357,9 +357,9 @@ impl Canvas { pub fn draw_commands(&self, - command_buffer: &mut AutoCommandBufferBuilder, + mut command_buffer: AutoCommandBufferBuilder, framebuffers: Vec>, - image_num: usize) { + image_num: usize) -> AutoCommandBufferBuilder { // Specify the color to clear the framebuffer with i.e. blue let clear_values = vec!(ClearValue::Float([0.0, 0.0, 1.0, 1.0])); @@ -391,9 +391,9 @@ impl Canvas { } } - command_buffer = command_buffer + command_buffer .end_render_pass() - .unwrap(); + .unwrap() } } diff --git a/src/vkprocessor.rs b/src/vkprocessor.rs index e0d445d3..d1855a73 100644 --- a/src/vkprocessor.rs +++ b/src/vkprocessor.rs @@ -412,7 +412,7 @@ impl<'a> VkProcessor<'a> { I can't replace canvas. */ - self.canvas.draw_commands(&mut command_buffer, framebuffers, image_num); + let mut command_buffer = self.canvas.draw_commands(command_buffer, framebuffers, image_num); //self.canvas = mem::replace(&mut self.canvas,