Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::BufferObjectArray Class Reference

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)
 
BufferObjectArrayoperator= (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 BufferObjectgetBufferObject (size_t location=0) const
 
size_t maxSize () const
 

Detailed Description

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.

Note
An OpenGL Vertex Array Object is tied to a render context and only valid within the same render context that was active when creating it.

Member Function Documentation

◆ attachBufferObject()

void inviwo::BufferObjectArray::attachBufferObject ( const BufferObject * obj,
GLuint location,
BindingType bindingType = BindingType::Native )

Attach buffer object obj to a specific location location.

Precondition
The BufferObjectArray must be bound
Exceptions
Exceptionif another buffer object is alread attached to location location.
RangeExceptionif location is invalid. That is location >= maxSize().
See also
attachBufferObjectForce maxSize

◆ attachBufferObjectEnforce()

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.

Precondition
The BufferObjectArray must be bound
Exceptions
RangeExceptionif location is invalid. That is location >= maxSize().
See also
attachBufferObject maxSize

◆ bind()

void inviwo::BufferObjectArray::bind ( ) const

Bind the VAO

◆ clear()

void inviwo::BufferObjectArray::clear ( )

Removes all buffer attachments from the VAO

Precondition
The BufferObjectArray must be bound

◆ detachBufferObject()

void inviwo::BufferObjectArray::detachBufferObject ( GLuint location)

Detach the buffer object at location location, if attached, and disable that vertex attribute array.

Precondition
The BufferObjectArray must be bound
Exceptions
RangeExceptionif location is invalid. That is location >= maxSize().

◆ getId()

GLuint inviwo::BufferObjectArray::getId ( ) const

Return the OpenGL ID of the VAO

◆ maxSize()

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.

Returns
maximum number of buffers that can be attached to this BufferObjectArray

◆ unbind()

void inviwo::BufferObjectArray::unbind ( ) const

Unbind the VAO by binding id 0


The documentation for this class was generated from the following file: