From cf94736cbfb03e63753c60d0fd55fd8c6b90dddf Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 1 Aug 2019 00:38:23 +0000 Subject: [PATCH] OpenGL: Free VAO and VBO --- src/Backends/Rendering/OpenGL3.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Backends/Rendering/OpenGL3.cpp b/src/Backends/Rendering/OpenGL3.cpp index 73f666ff..69e0e3fe 100644 --- a/src/Backends/Rendering/OpenGL3.cpp +++ b/src/Backends/Rendering/OpenGL3.cpp @@ -42,8 +42,9 @@ static GLuint program_glyph; static GLint program_colour_fill_uniform_colour; static GLint program_glyph_uniform_colour; -static GLuint framebuffer_id; +static GLuint vertex_array_id; static GLuint vertex_buffer_id; +static GLuint framebuffer_id; static VertexBuffer vertex_buffer; @@ -205,7 +206,6 @@ BOOL Backend_Init(SDL_Window *p_window) glClear(GL_COLOR_BUFFER_BIT); // Set up Vertex Array Object - GLuint vertex_array_id; glGenVertexArrays(1, &vertex_array_id); glBindVertexArray(vertex_array_id); @@ -260,6 +260,8 @@ void Backend_Deinit(void) glDeleteProgram(program_colour_fill); glDeleteProgram(program_texture_colour_key); glDeleteProgram(program_texture); + glDeleteBuffers(1, &vertex_buffer_id); + glDeleteVertexArrays(1, &vertex_array_id); SDL_GL_DeleteContext(context); }