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
04d8c453
Commit
04d8c453
authored
Nov 07, 2016
by
Anakin
Browse files
fdsgds<gv<df
parent
ed66d77b
Changes
1
Hide whitespace changes
Inline
Side-by-side
MshViewer/Source/OpenGlController.cpp
View file @
04d8c453
...
...
@@ -277,9 +277,6 @@ void OpenGLController::updateScene()
for
(
unsigned
int
modelIndex
=
0
;
modelIndex
<
vModels
.
size
();
modelIndex
++
)
{
// give the MVPs to the shader
glBindBuffer
(
GL_UNIFORM_BUFFER
,
gluiInstanceBufferID
);
glBufferSubData
(
GL_UNIFORM_BUFFER
,
sizeof
(
glm
::
mat4
),
NULL
,
&
getMVPMatrix
(
0
));
glBindBuffer
(
GL_UNIFORM_BUFFER
,
0
);
//glUniformMatrix4fv(gluiMatrixID, 1, GL_FALSE, &getMVPMatrix(modelIndex)[0][0]);
...
...
@@ -385,4 +382,14 @@ void OpenGLController::loadMsh(const char * path)
tempBufferData
.
data
(),
GL_STATIC_DRAW
);
//TODO: limit to max model count
std
::
vector
<
glm
::
mat4
>
tempMVPs
;
for
(
int
i
=
0
;
i
<
vModels
.
size
();
i
++
)
tempMVPs
.
push_back
(
getMVPMatrix
(
i
));
glBindBuffer
(
GL_UNIFORM_BUFFER
,
gluiInstanceBufferID
);
glBufferSubData
(
GL_UNIFORM_BUFFER
,
sizeof
(
glm
::
mat4
)
*
vModels
.
size
(),
NULL
,
tempMVPs
.
data
());
glBindBuffer
(
GL_UNIFORM_BUFFER
,
0
);
}
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