Commit ee73c16e authored by Anakin's avatar Anakin
Browse files

implemented destructor,

bug: callback does not modify the right oglcontroller
parent f57614fd
......@@ -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
);
}
......@@ -8,7 +8,7 @@ int main(int argc, char** argv)
{
OpenGLController scene = OpenGLController::getInstance();
scene.loadMsh("");
//scene.loadMsh("");
do {
scene.updateScene();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment