Commit 95626ed1 authored by Janis Born's avatar Janis Born
Browse files

add ElementArrayBuffer::setDataElements

parent c4db7ab1
......@@ -56,8 +56,7 @@ public:
{
elementArrayBuffer->bind();
GLsizeiptr bytesInBuffer = mElements / getGLTypeSize(mType);
elementArrayBuffer->setData( bytesInBuffer, mpData );
elementArrayBuffer->setDataElements(mElements, mpData);
}
return elementArrayBuffer;
}
......
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment