Add Drop implementations for OpenGL structures
This commit is contained in:
parent
3dafec076b
commit
4f22e6f518
|
@ -754,6 +754,16 @@ impl QuadRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for QuadRenderer {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
gl::DeleteBuffers(1, &self.vbo_instance);
|
||||
gl::DeleteBuffers(1, &self.ebo);
|
||||
gl::DeleteVertexArrays(1, &self.vao);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> RenderApi<'a> {
|
||||
pub fn clear(&self, color: Rgb) {
|
||||
unsafe {
|
||||
|
@ -1402,3 +1412,11 @@ impl Atlas {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Atlas {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
gl::DeleteTextures(1, &self.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -344,6 +344,15 @@ impl RectRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for RectRenderer {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
gl::DeleteBuffers(1, &self.vbo);
|
||||
gl::DeleteVertexArrays(1, &self.vao);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Rectangle drawing program.
|
||||
#[derive(Debug)]
|
||||
pub struct RectShaderProgram {
|
||||
|
|
Loading…
Reference in New Issue