Inviwo 0.9.12-pre
Inviwo documentation
|
Inviwo wrapper for OpengL Vertex Array Objects (VAO) More...
#include <bufferobjectarray.h>
Public Types | |
using | BindingType = BufferObject::BindingType |
Public Member Functions | |
BufferObjectArray (const BufferObjectArray &rhs) | |
BufferObjectArray & | operator= (const BufferObjectArray &that) |
GLuint | getId () const |
void | bind () const |
void | unbind () const |
bool | isActive () const |
Check if this VAO is currently bound. | |
void | clear () |
void | attachBufferObject (const BufferObject *obj, GLuint location, BindingType bindingType=BindingType::Native) |
void | attachBufferObjectEnforce (const BufferObject *obj, GLuint location, BindingType bindingType=BindingType::Native) |
void | detachBufferObject (GLuint location) |
BindingType | getBindingType (size_t location) const |
void | setBindingType (size_t location, BindingType bindingType) |
const BufferObject * | getBufferObject (size_t location=0) const |
size_t | maxSize () const |
Inviwo wrapper for OpengL Vertex Array Objects (VAO)
Handles the creation and deletion of OpenGL VAOs. Has functions for attaching and detaching buffer objects. It also keeps track of all attached buffers and corresponding attribute locations.
void inviwo::BufferObjectArray::attachBufferObject | ( | const BufferObject * | obj, |
GLuint | location, | ||
BindingType | bindingType = BindingType::Native ) |
Attach buffer object obj
to a specific location location
.
Exception | if another buffer object is alread attached to location location . |
RangeException | if location is invalid. That is location >= maxSize(). |
void inviwo::BufferObjectArray::attachBufferObjectEnforce | ( | const BufferObject * | obj, |
GLuint | location, | ||
BindingType | bindingType = BindingType::Native ) |
Enforce the attachment of buffer object obj
to a specific location location
. Overrides any existing binding for this location.
RangeException | if location is invalid. That is location >= maxSize(). |
void inviwo::BufferObjectArray::bind | ( | ) | const |
Bind the VAO
void inviwo::BufferObjectArray::clear | ( | ) |
Removes all buffer attachments from the VAO
void inviwo::BufferObjectArray::detachBufferObject | ( | GLuint | location | ) |
Detach the buffer object at location location
, if attached, and disable that vertex attribute array.
RangeException | if location is invalid. That is location >= maxSize(). |
GLuint inviwo::BufferObjectArray::getId | ( | ) | const |
Return the OpenGL ID of the VAO
size_t inviwo::BufferObjectArray::maxSize | ( | ) | const |
Return the maximum number of buffers that can be attached to a VAO as supported by the OpenGL hardware. The result corresponds to GL_MAX_VERTEX_ATTRIBS
.
void inviwo::BufferObjectArray::unbind | ( | ) | const |
Unbind the VAO by binding id 0