Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OpenGL
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
C-Fu
OpenGL
Commits
9298d882
Commit
9298d882
authored
8 years ago
by
Anakin
Browse files
Options
Downloads
Patches
Plain Diff
cleaning up before loading new stuff,
next step: calculate best first view position
parent
91b65bf6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
MshViewer/Header/OpenGLController.h
+1
-0
1 addition, 0 deletions
MshViewer/Header/OpenGLController.h
MshViewer/Source/OpenGlController.cpp
+26
-18
26 additions, 18 deletions
MshViewer/Source/OpenGlController.cpp
with
27 additions
and
18 deletions
MshViewer/Header/OpenGLController.h
+
1
−
0
View file @
9298d882
...
...
@@ -94,6 +94,7 @@ private:
// private functions
private
:
void
processInit
();
void
deleteVectors
();
void
startGLFW
();
void
createWindow
();
...
...
This diff is collapsed.
Click to expand it.
MshViewer/Source/OpenGlController.cpp
+
26
−
18
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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment