Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
C-Fu
OpenGL
Commits
9298d882
Commit
9298d882
authored
Nov 12, 2016
by
Anakin
Browse files
cleaning up before loading new stuff,
next step: calculate best first view position
parent
91b65bf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
MshViewer/Header/OpenGLController.h
View file @
9298d882
...
...
@@ -94,6 +94,7 @@ private:
// private functions
private:
void
processInit
();
void
deleteVectors
();
void
startGLFW
();
void
createWindow
();
...
...
MshViewer/Source/OpenGlController.cpp
View file @
9298d882
...
...
@@ -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
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment