|
AvogadroLibs 1.100.0
|
Buffer object to store geometry/attribute data on the GPU. More...
#include <avogadro/rendering/bufferobject.h>
Public Types | |
| enum | ObjectType { ArrayBuffer , ElementArrayBuffer } |
Public Member Functions | |
| BufferObject (ObjectType type=ArrayBuffer) | |
| ObjectType | type () const |
| Index | handle () const |
| bool | ready () const |
| template<class ContainerT > | |
| bool | upload (const ContainerT &array, ObjectType type) |
| bool | bind () |
| bool | release () |
| std::string | error () const |
This class creates GPU buffer object, and uploads the data to the GPU.
| ObjectType type | ( | ) | const |
Get the type of the buffer object.
| Index handle | ( | ) | const |
Get the handle of the buffer object.
| bool ready | ( | ) | const |
Determine if the buffer object is ready to be used.
| bool upload | ( | const ContainerT & | array, |
| BufferObject::ObjectType | objectType | ||
| ) |
Upload data to the buffer object. The BufferObject::type() must match type or be uninitialized.
The ContainerT type must have tightly packed values of ContainerT::value_type accessible by reference via ContainerT::operator[]. Additionally, the standard size() and empty() methods must be implemented. The std::vector and Avogadro::Core::Array classes are examples of such supported containers.
| bool bind | ( | ) |
Bind the buffer object ready for rendering.
| bool release | ( | ) |
Release the buffer. This should be done after rendering is complete.
| std::string error | ( | ) | const |
Return a string describing errors.