ref: cf94736cbfb03e63753c60d0fd55fd8c6b90dddf
parent: d8d971c45953462282f5cdd6ececc2f90127ae7c
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jul 31 20:38:23 EDT 2019
OpenGL: Free VAO and VBO
--- a/src/Backends/Rendering/OpenGL3.cpp
+++ b/src/Backends/Rendering/OpenGL3.cpp
@@ -42,8 +42,9 @@
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 @@
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 @@
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);
}