From e844a8b94a6ec137ef4d30d039fc5223919ea363 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 8 May 2023 15:24:06 +0200 Subject: [PATCH] free texture --- src/credits.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/credits.c b/src/credits.c index 88c7a84..ac275ab 100644 --- a/src/credits.c +++ b/src/credits.c @@ -9,6 +9,7 @@ static const char matrix_proj[] = "proj"; static void init(void); static void draw(void); +static void deinit(void); void credits(int state) { switch (state) { @@ -20,6 +21,10 @@ void credits(int state) { draw(); break; + case GL4DH_FREE: + deinit(); + break; + default: break; } @@ -86,3 +91,10 @@ static void draw(void) { glUseProgram(0); } + +static void deinit(void) { + if (_texId) { + glDeleteTextures(1, &_texId); + _texId = 0; + } +}