Inviwo
0.9.10.1
Inviwo documentation
|
Public Types | |
enum | BindingType { BindingType::Native, BindingType::ForceFloat, BindingType::ForceNormalizedFloat } |
Public Member Functions | |
BufferObject (size_t sizeInBytes, const DataFormatBase *format, BufferUsage usage, BufferTarget target=BufferTarget::Data) | |
BufferObject (const BufferObject &rhs) | |
BufferObject (BufferObject &&rhs) | |
BufferObject & | operator= (const BufferObject &other) |
BufferObject & | operator= (BufferObject &&other) |
virtual BufferObject * | clone () const |
GLenum | getFormatType () const |
GLenum | getTarget () const |
GLuint | getId () const |
GLFormats::GLFormat | getGLFormat () const |
const DataFormatBase * | getDataFormat () const |
void | bind () const |
void | unbind () const |
void | bindAndSetAttribPointer (GLuint location, BindingType bindingType=BindingType::Native) const |
bind the buffer object and set the vertex attribute pointer More... | |
void | setSize (GLsizeiptr sizeInBytes) |
void | upload (const void *data, GLsizeiptr sizeInBytes) |
void | download (void *data) const |
Public Member Functions inherited from inviwo::Observable< BufferObjectObserver > | |
Observable (const Observable< BufferObjectObserver > &other) | |
Observable (Observable< BufferObjectObserver > &&other) | |
Observable< BufferObjectObserver > & | operator= (const Observable< BufferObjectObserver > &other) |
Observable< BufferObjectObserver > & | operator= (Observable< BufferObjectObserver > &&other) |
void | addObserver (BufferObjectObserver *observer) |
void | removeObserver (BufferObjectObserver *observer) |
virtual void | startBlockingNotifications () override final |
virtual void | stopBlockingNotifications () override final |
Additional Inherited Members | |
Protected Member Functions inherited from inviwo::Observable< BufferObjectObserver > | |
void | forEachObserver (C callback) |
Protected Member Functions inherited from inviwo::ObservableInterface | |
void | addObservationHelper (Observer *observer) |
void | removeObservationHelper (Observer *observer) |
|
strong |
Type of binding when setting glVertexAttrib*Pointer.
See glVertexAttribPointer and Vertex Specification for details.
void inviwo::BufferObject::bindAndSetAttribPointer | ( | GLuint | location, |
BindingType | bindingType = BindingType::Native |
||
) | const |
bind the buffer object and set the vertex attribute pointer
This will bind the buffer object and then set the respective glVertexAttrib*Pointer. By default, i.e. bindingType
= BindingType::Native, glVertexAttribIPointer (note the 'I') is used for scalar types and glVertexAttribPointer will be used for floating point types. This behavior can be overwritten by bindingType
. Then the buffer is only accessible using float
in the shader.
location | used to set the vertex attribute location |
bindingType | determines which glVertexAttrib*Pointer is used |
void inviwo::BufferObject::setSize | ( | GLsizeiptr | sizeInBytes | ) |
Set the size of the buffer in bytes. Convenience function for calling initialize(nullptr, sizeInBytes)
sizeInBytes |