HWIndexBuffer Class Reference


Detailed Description

This class is our hw index buffer representation.

This class is our hw index buffer representation. It is just basically a list of DWORDs or WORDs and a description of the number of indices per element.

#include <HWIndex.h>

Inheritance diagram for HWIndexBuffer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  HWIndexBuffer (unsigned int count, unsigned int indicesPerPrimitive, bool use16Bit)
  Constructor.
DllExport  ~HWIndexBuffer ()
  Destructor.
DllExport void  FreeBuffer ()
  This frees all our index buffers.
DllExport const unsigned int  NumberPrimitives ()
  returns the number of primitives in the index buffer
DllExport const unsigned int  IndicesPerPrimitive ()
  Returns the number of indices per primitive.
*DllExport const unsigned int  Size ()
  The size of the buffer in bytes.
DllExport bool  SetNumberPrimitives (unsigned int ct)
  This lets you reset the number of primitives.
DllExport bool  Is16Bit ()
  This returns whether the buffers are 16 or 32 bit.
DllExport HWIndex32Bit  GetHWIndex32Bit (int index)
  Returns a particular 32 bit HWIndex.
DllExport HWIndex16Bit  GetHWIndex16Bit (int index)
  Returns a particular 16 bit HWIndex.
DllExport const DWORD *  GetRawBufferPointer ()
  Returns the raw pointer to the 32 but buffer.
DllExport const WORD *  GetRawBufferPointer16Bit ()
  Returns the raw pointer to the 16 bit buffer.

Constructor & Destructor Documentation

DllExport HWIndexBuffer ( unsigned int  count,
unsigned int  indicesPerPrimitive,
bool  use16Bit 
)

Constructor.

HWIndexBuffer(unsigned int count, unsigned int indicesPerPrimitive, bool use16Bit) Constructor

Parameters:
count - this is the number of primitives for this buffer to be allocated
indicesPerPrimitive - this is the number of indices per primitive
use16Bit - this is whether to use 16 bit buffers for the indices
DllExport ~HWIndexBuffer ( )

Destructor.


Member Function Documentation

DllExport void FreeBuffer ( )

This frees all our index buffers.

This frees all our index buffers and resets the count to 0

DllExport const unsigned int NumberPrimitives ( )

returns the number of primitives in the index buffer

Returns:
the number of primitives in the index buffer
DllExport const unsigned int IndicesPerPrimitive ( )

Returns the number of indices per primitive.

Returns:
the number of indices per primitive ie a triangle 3, line list 2 etc
* DllExport const unsigned int Size ( )

The size of the buffer in bytes.

Returns:
the size of index buffer in bytes
DllExport bool SetNumberPrimitives ( unsigned int  ct )

This lets you reset the number of primitives.

This lets you reset the number of primitives in the list it will keep the original data. It will returns true if successful.

Parameters:
ct is the new size for the buffer
Returns:
true is successful otherwise it ran out of memory
DllExport bool Is16Bit ( )

This returns whether the buffers are 16 or 32 bit.

Returns:
whether the buffers are 16 or 32 bit. Right now we tend to use 16 bit buffers and split up the mesh to fit into those buffers so we can reduce the memory foot print.
DllExport HWIndex32Bit GetHWIndex32Bit ( int  index )

Returns a particular 32 bit HWIndex.

Returns a particular 32 bit HWIndex. This is useful if you dont want to look up the offsets by hand /param int index - the index of that you want

Returns:
a particular 32 bit HWIndex
DllExport HWIndex16Bit GetHWIndex16Bit ( int  index )

Returns a particular 16 bit HWIndex.

Returns a particular 16 bit HWIndex. This is useful if you dont want to look up the offsets by hand /param int index - the index of that you want

DllExport const DWORD* GetRawBufferPointer ( )

Returns the raw pointer to the 32 but buffer.

Returns:
Access to the raw 32 bit data. This is only valid if the buffer is not set to 16 bit
DllExport const WORD* GetRawBufferPointer16Bit ( )

Returns the raw pointer to the 16 bit buffer.

Returns:
Access to the raw 16 bit data. This is only valid if the buffer is set to 16 bit

HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer
HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer HWIndexBuffer