From 6acb7552a3b67fe27fea679b36a8f4af45048dad Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Tue, 26 Mar 2024 00:37:36 +0000 Subject: [PATCH] label: destroy texture (#230) * label: destroy texture * misc: gitignore --- .gitignore | 6 +++++- src/renderer/Texture.cpp | 4 ++++ src/renderer/Texture.hpp | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2905419..03bade0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +.cache +.direnv +.envrc .vscode/ build/ +compile_commands.json +protocols/*.c protocols/*.h -protocols/*.c \ No newline at end of file diff --git a/src/renderer/Texture.cpp b/src/renderer/Texture.cpp index 96b4987..166baef 100644 --- a/src/renderer/Texture.cpp +++ b/src/renderer/Texture.cpp @@ -4,6 +4,10 @@ CTexture::CTexture() { // naffin' } +CTexture::~CTexture() { + destroyTexture(); +} + void CTexture::destroyTexture() { if (m_bAllocated) { glDeleteTextures(1, &m_iTexID); diff --git a/src/renderer/Texture.hpp b/src/renderer/Texture.hpp index 56f0e67..606d2a4 100644 --- a/src/renderer/Texture.hpp +++ b/src/renderer/Texture.hpp @@ -13,6 +13,7 @@ enum TEXTURETYPE { class CTexture { public: CTexture(); + ~CTexture(); void destroyTexture(); void allocate();