handle window exits more gracefully and appropriately.

This commit is contained in:
2025-09-15 14:15:40 +02:00
parent 1e10fec9c6
commit dc3abf992b
5 changed files with 41 additions and 8 deletions

View File

@@ -2,9 +2,8 @@
* Licensed under the MIT Licence. See LICENSE for details */
#include "render.h"
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#include <glad/gl.h>
#include <stdint.h>
#include "../error.h"
@@ -80,3 +79,12 @@ void render_update(GLFWwindow *win) {
glBindVertexArray(vao);
glDrawArrays(GL_POINTS, 0, VERTC);
}
void render_free(void) {
glDeleteVertexArrays(1, &vao);
glDeleteBuffers(1, &vbo);
glDeleteProgram(pipe);
vbo = 0;
vao = 0;
pipe = 0;
}