Open Inventor Reference
SoVBO Class Reference

SoVBO is used to manage OpenGL vertex buffer objects. More...

#include <Inventor/misc/SoVBO.h>

List of all members.

Public Member Functions

 SoVBO (GLenum type)
 create VBO of type GL_ARRAY_BUFFER (for vertex/normal/color etc. data) or GL_ELEMENT_ARRAY_BUFFER for index data
 ~SoVBO ()
bool bind (SoState *state)
 bind the buffer to GL, transfer data if not already done.
void unbind ()
 unbind the VBO in the GL state
void setData (int numBytes, const void *data, int nodeId, SoState *state)
 sets the client buffer data, ownership stays with the caller
uint32_t getDataId () const
 get the node id of the data
void clearData ()
 clears the data, freeing it when it is owned by VBO
const void * getData () const
 get the data pointer
void freeGL (SoState *state=NULL)
 free the GL part of the VBO (if state is passed, the VBO may be deleted immediately)
bool hasSwappedRGBAData () const
 returns if the stored data has been swapped to be compatible to OpenGL on little endian machines
void copyAndSwapPackedRGBA (SoState *state)
 allocates new data buffer, copies the values set by setData() and swaps them bytewise, needed for little endian machines sets hasSwappedRGBAData() flag

Static Public Member Functions

static bool shouldUseVBO (SoState *state, int numData)
 returns if a VBO should be used depending on given state and the number of data elements (not bytes)
static bool isVertexArrayRenderingAllowed ()
 returns of vertex array rendering is allowed.

Detailed Description

Note that the creation of a real OpenGL VBO is deferred until bind() is called, so that the VBO is created lazily. (MeVis ONLY)

Definition at line 51 of file SoVBO.h.


Constructor & Destructor Documentation

SoVBO::SoVBO ( GLenum  type)
SoVBO::~SoVBO ( )

Member Function Documentation

bool SoVBO::bind ( SoState state)

Returns true if the VBO could be bound and false otherwise. If the bind call fails, this typically means an out of memory condition because the VBO does not fit on the graphics board.

void SoVBO::clearData ( )
void SoVBO::copyAndSwapPackedRGBA ( SoState state)
void SoVBO::freeGL ( SoState state = NULL)
const void* SoVBO::getData ( ) const [inline]

Definition at line 84 of file SoVBO.h.

uint32_t SoVBO::getDataId ( ) const [inline]

Definition at line 78 of file SoVBO.h.

bool SoVBO::hasSwappedRGBAData ( ) const [inline]

Definition at line 90 of file SoVBO.h.

static bool SoVBO::isVertexArrayRenderingAllowed ( ) [static]

Default is true, this can be disabled by setting the IV_NO_VERTEX_ARRAY environment variable.

void SoVBO::setData ( int  numBytes,
const void *  data,
int  nodeId,
SoState state 
)
static bool SoVBO::shouldUseVBO ( SoState state,
int  numData 
) [static]
void SoVBO::unbind ( )

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