cleaning up before loading new stuff,
next step: calculate best first view position
This commit is contained in:
parent
91b65bf6e3
commit
9298d88260
|
@ -94,6 +94,7 @@ private:
|
|||
// private functions
|
||||
private:
|
||||
void processInit();
|
||||
void deleteVectors();
|
||||
|
||||
void startGLFW();
|
||||
void createWindow();
|
||||
|
|
|
@ -28,24 +28,7 @@ OpenGLController::~OpenGLController()
|
|||
glDeleteTextures(1, &gluiSamplerID);
|
||||
glfwTerminate();
|
||||
|
||||
while (!vModels.empty())
|
||||
{
|
||||
Modl* cursor = vModels.back();
|
||||
vModels.pop_back();
|
||||
|
||||
delete cursor->uv;
|
||||
delete cursor->mesh;
|
||||
delete cursor->vertex;
|
||||
delete cursor;
|
||||
}
|
||||
|
||||
while (!vTextures.empty())
|
||||
{
|
||||
textureData* cursor = vTextures.back();
|
||||
vTextures.pop_back();
|
||||
delete cursor->data;
|
||||
delete cursor;
|
||||
}
|
||||
deleteVectors();
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,6 +107,28 @@ void OpenGLController::processInit()
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
}
|
||||
|
||||
void OpenGLController::deleteVectors()
|
||||
{
|
||||
while (!vModels.empty())
|
||||
{
|
||||
Modl* cursor = vModels.back();
|
||||
vModels.pop_back();
|
||||
|
||||
delete cursor->uv;
|
||||
delete cursor->mesh;
|
||||
delete cursor->vertex;
|
||||
delete cursor;
|
||||
}
|
||||
|
||||
while (!vTextures.empty())
|
||||
{
|
||||
textureData* cursor = vTextures.back();
|
||||
vTextures.pop_back();
|
||||
delete cursor->data;
|
||||
delete cursor;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLController::startGLFW()
|
||||
{
|
||||
if (!glfwInit())
|
||||
|
@ -310,6 +315,9 @@ void OpenGLController::updateScene()
|
|||
|
||||
void OpenGLController::loadMsh(const char * path)
|
||||
{
|
||||
// clean up old stuff first
|
||||
deleteVectors();
|
||||
|
||||
// get all models
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue