VTK
Public Types | Public Member Functions
vtkgl::BufferObject Class Reference

OpenGL buffer object. More...

#include <vtkglBufferObject.h>

List of all members.

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.

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
ArrayBuffer 
ElementArrayBuffer 

Definition at line 32 of file vtkglBufferObject.h.


Constructor & Destructor Documentation


Member Function Documentation

Get the type of the buffer object.

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.

template<class T >
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.

template<class T >
bool vtkgl::BufferObject::Upload ( const T *  array,
size_t  numElements,
BufferObject::ObjectType  objectType 
) [inline]

Definition at line 112 of file vtkglBufferObject.h.

Bind the buffer object ready for rendering.

Note:
Only one ARRAY_BUFFER and one ELEMENT_ARRAY_BUFFER may be bound at any time.

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.


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