HWVertexBuffer Class Reference


Detailed Description

This is a class that lets you create a hw vertex buffer.

It allows you to define, create, edit and access the buffer

#include <HWVertex.h>

Inheritance diagram for HWVertexBuffer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  HWVertexBuffer (DWORD vType)
  Constructor.
DllExport  ~HWVertexBuffer ()
  Destructor.
DllExport void  FreeBuffer ()
  Frees the vertex buffer.
DllExport void  SetUVWSize (unsigned int id, unsigned int size)
  This sets the size of each UVW channel.
DllExport void  SetMaxMapChannel (unsigned int hwChannel, int maxMapChannel)
  This lets you associate a HW texture channel with a max map channel.
DllExport int  GetMaxMapChannel (unsigned int hwChannel)
  This lets get the map channel associated with a hw channel.
DllExport bool  CreateBuffer (unsigned int numVertice)
  This allocates our buffer. Returns false if the buffer creation failed.
DllExport unsigned int  GetStride ()
  returns the stride in bytes of a hw vertex
DllExport unsigned int  Size ()
  returns the size in bytes of the entire buffer
DllExport unsigned int  NumberVertices ()
  returns the number of hw vertices in the buffer
DllExport bool  SetNumberVertices (unsigned int ct)
  this lets you set the size of the buffer,
DllExport HWVertex  GetHWVert (int id)
  This returns a hwvertex of a specific vertex.
DllExport BYTE *  GetRawBufferPointer ()
  returns a raw pointer to the vertex buffer
DllExport void  SetHasConnectionData (bool hasConnectionData)
  This lets you set whether the vertex buffer will also maintain a connection list back to the original geometry.
DllExport bool  GetHasConnectionData ()
  This returns whether the vertex buffer has connection data back to the original geometry.
DllExport void  SetConnectionData (unsigned int i, unsigned int oldPosID, int oldNormalID)
  This lets you set the connection data.
DllExport unsigned int *  GetPositionConnectionList ()
  This returns position mapping list.
DllExport int *  GetNormalConnectionList ()
  This returns normal mapping list.

Constructor & Destructor Documentation

DllExport HWVertexBuffer ( DWORD  vType )

Constructor.

Parameters:
[in] vType the description of the HW vertex which can be any combination of VertexType
DllExport ~HWVertexBuffer ( )

Destructor.


Member Function Documentation

DllExport void FreeBuffer ( )

Frees the vertex buffer.

DllExport void SetUVWSize ( unsigned int  id,
unsigned int  size 
)

This sets the size of each UVW channel.

By default a UVW channel is 2 point3 a UV. you can change the size to just a U, UV, or UVW with this. This must be set before calling create buffer if you want to change the channel sizes

Parameters:
[in] id which channel
[in] size the size of the channel 1 to 3
DllExport void SetMaxMapChannel ( unsigned int  hwChannel,
int  maxMapChannel 
)

This lets you associate a HW texture channel with a max map channel.

Parameters:
[in] hwChannel the hw channel
[in] maxMapChannel the Max channel
DllExport int GetMaxMapChannel ( unsigned int  hwChannel )

This lets get the map channel associated with a hw channel.

Parameters:
[in] hwChannel the hw channel
DllExport bool CreateBuffer ( unsigned int  numVertice )

This allocates our buffer. Returns false if the buffer creation failed.

Parameters:
[in] numVertice is the number of hw vertices to create for this buffer
Returns:
true is succeeded, false if failed typically an out of mememory error
DllExport unsigned int GetStride ( )

returns the stride in bytes of a hw vertex

DllExport unsigned int Size ( ) [inline]

returns the size in bytes of the entire buffer

DllExport unsigned int NumberVertices ( ) [inline]

returns the number of hw vertices in the buffer

DllExport bool SetNumberVertices ( unsigned int  ct )

this lets you set the size of the buffer,

this lets you set the size of the buffer, it returns true if everything was allocated correctly /param unsigned int ct the number of vertices to set the buffer count to

DllExport HWVertex GetHWVert ( int  id ) [inline]

This returns a hwvertex of a specific vertex.

Parameters:
[in] id is which vertex you want to look at
DllExport BYTE* GetRawBufferPointer ( )

returns a raw pointer to the vertex buffer

DllExport void SetHasConnectionData ( bool  hasConnectionData )

This lets you set whether the vertex buffer will also maintain a connection list back to the original geometry.

Parameters:
[in] hasConnectionData whether the vertex buffer will also build connection info from the max mesh to the HW mesh
DllExport bool GetHasConnectionData ( )

This returns whether the vertex buffer has connection data back to the original geometry.

DllExport void SetConnectionData ( unsigned int  i,
unsigned int  oldPosID,
int  oldNormalID 
)

This lets you set the connection data.

This lets you set the connection data. It only tracks position and normals.

Parameters:
[in] i this is the index in the hw vertex buffer
[in] oldPosID this is the position index in max mesh vertex list
[in] oldNormalID this is the position index in max mesh gfxnormal list, set this value if you want to use the gfxfacenormal list. This is used when the face has no smoothing group
DllExport unsigned int* GetPositionConnectionList ( )

This returns position mapping list.

DllExport int* GetNormalConnectionList ( )

This returns normal mapping list.


HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer
HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer HWVertexBuffer