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
95626ed1
Commit
95626ed1
authored
Mar 07, 2012
by
Janis Born
Browse files
add ElementArrayBuffer::setDataElements
parent
c4db7ab1
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Controller/ElementArrayBufferControl.hh
View file @
95626ed1
...
...
@@ -56,8 +56,7 @@ public:
{
elementArrayBuffer
->
bind
();
GLsizeiptr
bytesInBuffer
=
mElements
/
getGLTypeSize
(
mType
);
elementArrayBuffer
->
setData
(
bytesInBuffer
,
mpData
);
elementArrayBuffer
->
setDataElements
(
mElements
,
mpData
);
}
return
elementArrayBuffer
;
}
...
...
include/ACGL/OpenGL/Objects/ElementArrayBuffer.hh
View file @
95626ed1
...
...
@@ -59,13 +59,21 @@ public:
//! datatype of the indices
inline
void
setType
(
GLenum
_type
)
{
mType
=
_type
;
}
//! set data for this buffer for a given number of elements (size in bytes == _elements * size of mType)
inline
void
setDataElements
(
uint_t
_elements
,
const
GLvoid
*
_pData
=
NULL
,
GLenum
_usage
=
GL_STATIC_DRAW
)
{
setData
(
mTarget
,
_elements
*
getGLTypeSize
(
mType
),
_pData
,
_usage
);
}
//! Returns the number of indices:
GLuint
getElements
()
{
inline
GLuint
getElements
()
const
{
return
(
GLuint
)(
getSize
()
/
getGLTypeSize
(
mType
));
}
//! Overloaded from the base class to _prevent_ redefining of the binding target! (see Buffer)
inline
void
setTarget
(
GLenum
)
{
inline
void
setTarget
(
GLenum
)
{
ACGL
::
Utils
::
error
()
<<
"DON'T redefine the target binding point of an ElementArrayBuffer"
<<
std
::
endl
;
}
...
...
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