destroy program in shader destructor

This commit is contained in:
Vaxry 2022-08-11 20:33:35 +02:00
parent b178891ab3
commit 37442db20e
2 changed files with 10 additions and 1 deletions

View file

@ -10,4 +10,11 @@ GLint CShader::getUniformLocation(const std::string& unif) {
}
return itpos->second;
}
CShader::~CShader() {
// destroy shader
if (program != 0) {
glDeleteProgram(program);
}
}

View file

@ -5,7 +5,9 @@
class CShader {
public:
GLuint program;
~CShader();
GLuint program = 0;
GLint proj;
GLint color;
GLint tex;