Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

oxygen::IndexBuffer Class Reference

IndexBuffer is intended as a cache for indeces pointing into a vertexbuffer to describe a set of triangles. More...

#include <indexbuffer.h>

List of all members.

Public Member Functions

 IndexBuffer ()
virtual ~IndexBuffer ()
void Cache (unsigned int numIndex, unsigned int *index)
 caches (i.e.
void Cache (unsigned int newIndex)
 appends a single index
void Flush ()
 empties the index buffer
int GetNumIndex () const
 returns the number of cached indeces
boost::shared_array< unsigned
int > 
GetIndex () const
 returns a cached index
void EnsureFit (unsigned int count)
 ensures that the index buffer can hold the additional (!) number of elements (creates new storage on demand, copys old data)

Protected Attributes

unsigned int mMaxIndex
 the maximum number of indices we can cache with the allocated memory
unsigned int mNumIndex
 the number of indices currently cached
boost::shared_array< unsigned
int > 
mIndex
 pointer to the memory, where we cache the indices


Detailed Description

IndexBuffer is intended as a cache for indeces pointing into a vertexbuffer to describe a set of triangles.

It is used together with the StaticMesh class

Definition at line 34 of file indexbuffer.h.


Constructor & Destructor Documentation

IndexBuffer::IndexBuffer  ) 
 

Definition at line 29 of file indexbuffer.cpp.

IndexBuffer::~IndexBuffer  )  [virtual]
 

Definition at line 32 of file indexbuffer.cpp.


Member Function Documentation

void IndexBuffer::Cache unsigned int  newIndex  ) 
 

appends a single index

Definition at line 45 of file indexbuffer.cpp.

References Cache().

Here is the call graph for this function:

void IndexBuffer::Cache unsigned int  numIndex,
unsigned int *  index
 

caches (i.e.

copies) an index list for rendering at a later point in time, growing the index cache if necessary.

Parameters:
numIndex number of indices to add to the cache
index pointer to index data

Definition at line 36 of file indexbuffer.cpp.

References EnsureFit(), mIndex, and mNumIndex.

Referenced by Cache().

Here is the call graph for this function:

void IndexBuffer::EnsureFit unsigned int  count  ) 
 

ensures that the index buffer can hold the additional (!) number of elements (creates new storage on demand, copys old data)

Definition at line 50 of file indexbuffer.cpp.

References mIndex, mMaxIndex, and mNumIndex.

Referenced by Cache().

void IndexBuffer::Flush  ) 
 

empties the index buffer

Definition at line 85 of file indexbuffer.cpp.

References mNumIndex.

shared_array< unsigned int > IndexBuffer::GetIndex  )  const
 

returns a cached index

Definition at line 95 of file indexbuffer.cpp.

References mIndex.

int IndexBuffer::GetNumIndex  )  const
 

returns the number of cached indeces

Definition at line 90 of file indexbuffer.cpp.

References mNumIndex.


Member Data Documentation

boost::shared_array<unsigned int> oxygen::IndexBuffer::mIndex [protected]
 

pointer to the memory, where we cache the indices

Definition at line 75 of file indexbuffer.h.

Referenced by Cache(), EnsureFit(), and GetIndex().

unsigned int oxygen::IndexBuffer::mMaxIndex [protected]
 

the maximum number of indices we can cache with the allocated memory

Definition at line 69 of file indexbuffer.h.

Referenced by EnsureFit().

unsigned int oxygen::IndexBuffer::mNumIndex [protected]
 

the number of indices currently cached

Definition at line 72 of file indexbuffer.h.

Referenced by Cache(), EnsureFit(), Flush(), and GetNumIndex().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:44:36 2006 for rcssserver3d by  doxygen 1.4.4