3ds Max C++ API Reference
HWIndexBuffer Class Reference

This class is our hw index buffer representation.
More...

#include <HWIndex.h>

+ Inheritance diagram for HWIndexBuffer:

Public Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

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.

Constructor & Destructor Documentation

◆ HWIndexBuffer()

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

◆ ~HWIndexBuffer()

Destructor.

Member Function Documentation

◆ FreeBuffer()

DllExport void FreeBuffer ( )

This frees all our index buffers.

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

◆ NumberPrimitives()

DllExport const unsigned int NumberPrimitives ( )

returns the number of primitives in the index buffer

Returns
the number of primitives in the index buffer

◆ IndicesPerPrimitive()

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

◆ Size()

DllExport const unsigned int Size ( )

The size of the buffer in bytes.

Returns
the size of index buffer in bytes *‍/

◆ SetNumberPrimitives()

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
ctis the new size for the buffer
Returns
true is successful otherwise it ran out of memory

◆ Is16Bit()

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.

◆ GetHWIndex32Bit()

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

◆ GetHWIndex16Bit()

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

◆ GetRawBufferPointer()

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

◆ GetRawBufferPointer16Bit()

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