implemented destructor,

bug: callback does not modify the right oglcontroller
This commit is contained in:
Anakin 2016-09-08 11:30:00 +02:00
parent f57614fd2a
commit ee73c16e1f
2 changed files with 8 additions and 4 deletions

View File

@ -24,6 +24,11 @@ OpenGLController& OpenGLController::getInstance(int oglMajor, int oglMinor)
OpenGLController::~OpenGLController()
{
glDeleteBuffers(1, &gluiUVBufferID);
glDeleteBuffers(1, &gluiVertexBufferID);
glDeleteVertexArrays(1, &gluiVertexArrayID);
glDeleteProgram(gluiShaderPrgmID);
glDeleteTextures(1, &gluiSamplerID);
glfwTerminate();
}
@ -120,6 +125,8 @@ void OpenGLController::processInit()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glGenerateMipmap(GL_TEXTURE_2D);
loadMsh("");
}
void OpenGLController::startGLFW()
@ -242,7 +249,6 @@ void OpenGLController::addTransZ(double value)
void OpenGLController::updateScene()
{
// get new matrices
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// use shader prgm
@ -298,5 +304,3 @@ void OpenGLController::loadMsh(const char * path)
GL_STATIC_DRAW
);
}

View File

@ -8,7 +8,7 @@ int main(int argc, char** argv)
{
OpenGLController scene = OpenGLController::getInstance();
scene.loadMsh("");
//scene.loadMsh("");
do {
scene.updateScene();