Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hurstel
CGoGN
Commits
2f953622
Commit
2f953622
authored
Nov 27, 2012
by
Kenneth Vanhoey
Browse files
Small bug correction in DataPerFaceRender.
parent
a30b1e96
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/Algo/Render/GL2/dataPerFaceRender.hpp
View file @
2f953622
...
...
@@ -59,7 +59,7 @@ DataPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboData, typen
std
::
vector
<
VEC3
>
buffer
;
buffer
.
reserve
(
16384
);
std
::
vector
<
VEC3
>
bufferData
;
std
::
vector
<
T
>
bufferData
;
bufferData
.
reserve
(
16384
);
TraversorCell
<
typename
PFP
::
MAP
,
FACE
>
traFace
(
map
,
good
);
...
...
@@ -91,10 +91,11 @@ DataPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboData, typen
memcpy
(
ptrPos
,
&
buffer
[
0
],
buffer
.
size
()
*
sizeof
(
VEC3
));
vboPosition
.
releasePtr
();
vboData
.
setDataSize
(
3
);
assert
(
sizeof
(
T
)
%
sizeof
(
float
)
==
0
||
!
"DataPerFaceRender::updateVBO: VBO's only work with data types which are a multiple of 4 bytes"
)
;
vboData
.
setDataSize
(
sizeof
(
T
)
/
sizeof
(
float
));
// Warning : works only for data types of 4 bytes (as do the VBO's)
vboData
.
allocate
(
bufferData
.
size
());
VEC3
*
ptr
Col
=
reinterpret_cast
<
VEC3
*>
(
vboData
.
lockPtr
());
memcpy
(
ptr
Col
,
&
bufferData
[
0
],
bufferData
.
size
()
*
sizeof
(
VEC3
));
T
*
ptr
Data
=
reinterpret_cast
<
T
*>
(
vboData
.
lockPtr
());
memcpy
(
ptr
Data
,
&
bufferData
[
0
],
bufferData
.
size
()
*
sizeof
(
T
));
vboData
.
releasePtr
();
}
...
...
@@ -105,9 +106,6 @@ inline void DataPerFaceRender::draw(Utils::GLSLShader* sh)
sh
->
disableVertexAttribs
();
}
}
//end namespace VBO
}
//end namespace Algo
...
...
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