Commit 2b58beab authored by Janis Born's avatar Janis Born
Browse files

add usage parameter for ElementArrayBufferControl

parent cd888c1a
......@@ -22,7 +22,8 @@ class ElementArrayBufferControl : public Resource::BasicCreateController<Element
// ========================================================================================================= \/
public:
ElementArrayBufferControl(void)
: mType(GL_UNSIGNED_INT),
: mUsage(GL_STATIC_DRAW),
mType(GL_UNSIGNED_INT),
mElements(0),
mpData(NULL)
{}
......@@ -32,7 +33,9 @@ public:
// ============================================================================================ METHODS \/
// ==================================================================================================== \/
public:
inline ElementArrayBufferControl& type (GLenum _type) { mType = _type; return *this; }
inline ElementArrayBufferControl& usage (GLenum _usage) { mUsage = _usage; return *this; }
inline ElementArrayBufferControl& type (GLenum _type) { mType = _type; return *this; }
inline ElementArrayBufferControl& data (const GLvoid* _pData, GLsizei _elements)
{
......@@ -52,7 +55,7 @@ public:
{
elementArrayBuffer->bind();
elementArrayBuffer->setDataElements(mElements, mpData);
elementArrayBuffer->setDataElements(mElements, mpData, mUsage);
}
return elementArrayBuffer;
}
......@@ -61,8 +64,9 @@ public:
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
protected:
GLenum mType;
GLsizei mElements;
GLenum mUsage;
GLenum mType;
GLsizei mElements;
const GLvoid* mpData;
};
......
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