diff --git a/src/gl_context.rs b/src/gl_context.rs index 0bce1eb..4e56b06 100644 --- a/src/gl_context.rs +++ b/src/gl_context.rs @@ -158,7 +158,7 @@ impl GLContext if self.draw_buffer.is_some() { let color_attachment_type = self.borrow_draw_buffer().unwrap().color_attachment_type(); - self.create_draw_buffer(size, color_attachment_type) + self.init_offscreen(size, color_attachment_type) } else { Err("No DrawBuffer found") } @@ -184,6 +184,8 @@ impl GLContextPrivateMethods for GLContext { debug_assert!(self.is_current()); unsafe { + gl::ClearColor(0.0, 0.0, 0.0, 0.0); + gl::Clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT | gl::STENCIL_BUFFER_BIT); gl::Scissor(0, 0, size.width, size.height); gl::Viewport(0, 0, size.width, size.height); }