VTK
|
OpenGL buffer object. More...
#include <vtkglBufferObject.h>
Public Types | |
enum | ObjectType { ArrayBuffer, ElementArrayBuffer } |
Public Member Functions | |
BufferObject (ObjectType type=ArrayBuffer) | |
~BufferObject () | |
ObjectType | GetType () const |
Get the type of the buffer object. | |
int | GetHandle () const |
Get the handle of the buffer object. | |
bool | IsReady () const |
Determine if the buffer object is ready to be used. | |
template<class T > | |
bool | Upload (const T &array, ObjectType type) |
Upload data to the buffer object. | |
template<class T > | |
bool | Upload (const T *array, size_t numElements, ObjectType type) |
bool | Bind () |
Bind the buffer object ready for rendering. | |
bool | Release () |
Release the buffer. | |
void | ReleaseGraphicsResources () |
std::string | GetError () const |
Return a string describing errors. |
OpenGL buffer object.
OpenGL buffer object to store index, geometry and/or attribute data on the GPU.
Definition at line 29 of file vtkglBufferObject.h.
Definition at line 32 of file vtkglBufferObject.h.
ObjectType vtkgl::BufferObject::GetType | ( | ) | const |
Get the type of the buffer object.
int vtkgl::BufferObject::GetHandle | ( | ) | const |
Get the handle of the buffer object.
bool vtkgl::BufferObject::IsReady | ( | ) | const [inline] |
Determine if the buffer object is ready to be used.
Definition at line 47 of file vtkglBufferObject.h.
bool vtkgl::BufferObject::Upload | ( | const T & | array, |
BufferObject::ObjectType | objectType | ||
) | [inline] |
Upload data to the buffer object.
The BufferObject::type() must match type or be uninitialized.
The T type must have tightly packed values of T::value_type accessible by reference via T::operator[]. Additionally, the standard size() and empty() methods must be implemented. The std::vector class is an example of such a supported containers.
Definition at line 98 of file vtkglBufferObject.h.
bool vtkgl::BufferObject::Upload | ( | const T * | array, |
size_t | numElements, | ||
BufferObject::ObjectType | objectType | ||
) | [inline] |
Definition at line 112 of file vtkglBufferObject.h.
bool vtkgl::BufferObject::Bind | ( | ) |
Bind the buffer object ready for rendering.
bool vtkgl::BufferObject::Release | ( | ) |
Release the buffer.
This should be done after rendering is complete.
std::string vtkgl::BufferObject::GetError | ( | void | ) | const [inline] |
Return a string describing errors.
Definition at line 85 of file vtkglBufferObject.h.