Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
b5f08a3f
Commit
b5f08a3f
authored
Jul 05, 2013
by
Janis Born
Browse files
add ArrayBuffer::setGeometryData
parent
99fcc3aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Objects/ArrayBuffer.hh
View file @
b5f08a3f
...
@@ -65,6 +65,9 @@
...
@@ -65,6 +65,9 @@
namespace
ACGL
{
namespace
ACGL
{
namespace
OpenGL
{
namespace
OpenGL
{
class
GeometryData
;
ACGL_SMARTPOINTER_TYPEDEFS
(
GeometryData
)
class
ArrayBuffer
:
public
Buffer
class
ArrayBuffer
:
public
Buffer
{
{
// ==================================================================================================== \/
// ==================================================================================================== \/
...
@@ -152,6 +155,9 @@ public:
...
@@ -152,6 +155,9 @@ public:
//! Setting of the stride size explicitly is not needed if the attributes are defined correctly (with padding)
//! Setting of the stride size explicitly is not needed if the attributes are defined correctly (with padding)
inline
void
setStride
(
GLsizei
_stride
)
{
mStride
=
_stride
;
}
inline
void
setStride
(
GLsizei
_stride
)
{
mStride
=
_stride
;
}
//! Sets all data (attributes, stride, size) to those specified in _geometryData. All previous data are overwritten.
void
setGeometryData
(
SharedGeometryData
_geometryData
);
//! removes all attributes
//! removes all attributes
inline
void
removeAttributes
(
void
)
inline
void
removeAttributes
(
void
)
{
{
...
...
src/ACGL/OpenGL/Objects/ArrayBuffer.cc
View file @
b5f08a3f
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
**********************************************************************/
**********************************************************************/
#include
<ACGL/OpenGL/Objects/ArrayBuffer.hh>
#include
<ACGL/OpenGL/Objects/ArrayBuffer.hh>
#include
<ACGL/OpenGL/Data/GeometryData.hh>
using
namespace
ACGL
;
using
namespace
ACGL
;
using
namespace
ACGL
::
OpenGL
;
using
namespace
ACGL
::
OpenGL
;
...
@@ -114,3 +115,16 @@ int32_t ArrayBuffer::getAttributeIndexByName(const std::string& _nameInArray) co
...
@@ -114,3 +115,16 @@ int32_t ArrayBuffer::getAttributeIndexByName(const std::string& _nameInArray) co
return
(
int32_t
)
i
;
return
(
int32_t
)
i
;
return
-
1
;
return
-
1
;
}
}
void
ArrayBuffer
::
setGeometryData
(
SharedGeometryData
_geometryData
)
{
removeAttributes
();
for
(
ArrayBuffer
::
AttributeVec
::
const_iterator
it
=
_geometryData
->
mAttributes
.
begin
();
it
!=
_geometryData
->
mAttributes
.
end
();
++
it
)
{
defineAttribute
(
*
it
);
}
setStride
(
_geometryData
->
getStrideSize
());
setData
(
_geometryData
->
getSize
(),
_geometryData
->
getData
());
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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