implemented destructor,
bug: callback does not modify the right oglcontroller
This commit is contained in:
parent
f57614fd2a
commit
ee73c16e1f
|
@ -24,6 +24,11 @@ OpenGLController& OpenGLController::getInstance(int oglMajor, int oglMinor)
|
||||||
|
|
||||||
OpenGLController::~OpenGLController()
|
OpenGLController::~OpenGLController()
|
||||||
{
|
{
|
||||||
|
glDeleteBuffers(1, &gluiUVBufferID);
|
||||||
|
glDeleteBuffers(1, &gluiVertexBufferID);
|
||||||
|
glDeleteVertexArrays(1, &gluiVertexArrayID);
|
||||||
|
glDeleteProgram(gluiShaderPrgmID);
|
||||||
|
|
||||||
glDeleteTextures(1, &gluiSamplerID);
|
glDeleteTextures(1, &gluiSamplerID);
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
}
|
}
|
||||||
|
@ -120,6 +125,8 @@ void OpenGLController::processInit()
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
loadMsh("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLController::startGLFW()
|
void OpenGLController::startGLFW()
|
||||||
|
@ -242,7 +249,6 @@ void OpenGLController::addTransZ(double value)
|
||||||
void OpenGLController::updateScene()
|
void OpenGLController::updateScene()
|
||||||
{
|
{
|
||||||
// get new matrices
|
// get new matrices
|
||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
// use shader prgm
|
// use shader prgm
|
||||||
|
@ -298,5 +304,3 @@ void OpenGLController::loadMsh(const char * path)
|
||||||
GL_STATIC_DRAW
|
GL_STATIC_DRAW
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
OpenGLController scene = OpenGLController::getInstance();
|
OpenGLController scene = OpenGLController::getInstance();
|
||||||
|
|
||||||
scene.loadMsh("");
|
//scene.loadMsh("");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
scene.updateScene();
|
scene.updateScene();
|
||||||
|
|
Loading…
Reference in New Issue