IHWDrawMesh Class Reference


Detailed Description

This is a wrapper around our low level HW mesh.

This is a interface around our low level vertex buffer this will allow you to directly update the low level buffers without recreating them, draw the buffers, and also give you access to release the buffers. This hides the actual vertex and index buffer away from the coder since it may be different depending on the device. Each GFX_MESH::HWMesh has a pointer to one of these. It has a simple reference counter to know when to get deleted since these can be batched up to be drawn and could potentially get deleted before the actual draw.

#include <HWMesh.h>

Inheritance diagram for IHWDrawMesh:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  IHWDrawMesh ()
  Constructor.
virtual  ~IHWDrawMesh ()
virtual void  Draw (GraphicsWindow *gw, DWORD attribute)=0
  This draws the mesh to the display using the current render limits.
virtual void  UpdateVertexBuffer (Point3 *vertexList, Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count, unsigned int *vertMapList, int *normalsMapList)=0
  Allows you direct access to the low level buffer to change values without recreating the mesh.
virtual void  Release ()=0
  This releases the buffers if the class is no longer referenced by anything. You should not delete this class but call Release on it.
DllExport void  MakeRef ()
  When ever you reference this pointer and want to hang onto it you need to call this.

Protected Member Functions

DllExport void  DecRefCount ()
  You should not typically call this but should call release when you are done with the pointer

.
DllExport bool  CanDelete ()
  returns whether the class can be deleted ie the ref count is zero

Protected Attributes

int  mRefCount

Constructor & Destructor Documentation

DllExport IHWDrawMesh ( )

Constructor.

virtual ~IHWDrawMesh ( ) [inline, virtual]
{ ; }

Member Function Documentation

virtual void Draw ( GraphicsWindow gw,
DWORD  attribute 
) [pure virtual]

This draws the mesh to the display using the current render limits.

Parameters:
gw the graphics window to draw the mesh to.
attribute if this mesh contains multiple matIDs this is which matID to draw. The old hwmesh stored multiple matIDs per mesh the new one only has one.

Implemented in HWTupleMeshContainer.

virtual void UpdateVertexBuffer ( Point3 vertexList,
Point3 gfxNormalList,
Point3 faceNormalList,
BitArray changedVerts,
int  count,
unsigned int *  vertMapList,
int *  normalsMapList 
) [pure virtual]

Allows you direct access to the low level buffer to change values without recreating the mesh.

Parameters:
vertexList This is a pointer of all the vertices on the mesh. The changed vertices should be in the list
gfxNormalList This is a pointer of all the gfx normals on the mesh. The changed vertices should be in the list
faceNormalList This is a pointer of all the face normals on the mesh
changedVerts This is a bitarray that tags which vertices are changed so we only update those vertices
count This is number of vertices in vertex List
vertMapList This is mapping that lets the HW vertex look up which vertex it belongs to
normalsMapList This is mapping that lets the HW vertex look up which normal it belongs to. If this value is negative it is made positive and then face normallist is used to lookup the normal This occurs when there is no smoothing group.

Implemented in HWTupleMeshContainer.

virtual void Release ( ) [pure virtual]

This releases the buffers if the class is no longer referenced by anything. You should not delete this class but call Release on it.

Implemented in HWTupleMeshContainer.

DllExport void MakeRef ( )

When ever you reference this pointer and want to hang onto it you need to call this.

DllExport void DecRefCount ( ) [protected]

You should not typically call this but should call release when you are done with the pointer

.

DllExport bool CanDelete ( ) [protected]

returns whether the class can be deleted ie the ref count is zero


Member Data Documentation


IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh
IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh IHWDrawMesh