Open Inventor Reference
SoVBO Class Reference

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

#include <Inventor/misc/SoVBO.h>

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
 
bool isValid (SoState *state)
 Returns if the VBO is valid and it's data is stored on the GPU.
 
void setData (int numBytes, const void *data, SbNodeIdType nodeId, SoState *state)
 sets the client buffer data, ownership stays with the caller
 
SbNodeIdType 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
 
void updateData (void *data)
 update the VBO data from the current data (bind() needs to be called before).
 

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.
 
static int getVboMinimumSizeLimit ()
 get the lower limit for VBO usage
 

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::SoVBO ( GLenum  type)

◆ ~SoVBO()

SoVBO::~SoVBO ( )

Member Function Documentation

◆ bind()

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.

◆ clearData()

void SoVBO::clearData ( )

◆ copyAndSwapPackedRGBA()

void SoVBO::copyAndSwapPackedRGBA ( SoState state)

◆ freeGL()

void SoVBO::freeGL ( SoState state = NULL)

◆ getData()

const void * SoVBO::getData ( ) const
inline

Definition at line 87 of file SoVBO.h.

◆ getDataId()

SbNodeIdType SoVBO::getDataId ( ) const
inline

Definition at line 81 of file SoVBO.h.

◆ getVboMinimumSizeLimit()

static int SoVBO::getVboMinimumSizeLimit ( )
inlinestatic

Definition at line 100 of file SoVBO.h.

◆ hasSwappedRGBAData()

bool SoVBO::hasSwappedRGBAData ( ) const
inline

Definition at line 93 of file SoVBO.h.

◆ isValid()

bool SoVBO::isValid ( SoState state)

◆ isVertexArrayRenderingAllowed()

static bool SoVBO::isVertexArrayRenderingAllowed ( )
static

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

◆ setData()

void SoVBO::setData ( int  numBytes,
const void *  data,
SbNodeIdType  nodeId,
SoState state 
)

◆ shouldUseVBO()

static bool SoVBO::shouldUseVBO ( SoState state,
int  numData 
)
static

◆ unbind()

void SoVBO::unbind ( )

◆ updateData()

void SoVBO::updateData ( void *  data)

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