Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #pragma once
00056
00057 #include "maxheap.h"
00058 #include "tab.h"
00059 #include "HWVertex.h"
00060 #include "HWIndex.h"
00061
00062 class BitArray;
00063 class GraphicsWindow;
00064 class Point3;
00065
00066 namespace GFX_MESH
00067 {
00068
00069
00071
00078 class IHWDrawMesh : public MaxHeapOperators
00079 {
00080
00081 public:
00083 DllExport IHWDrawMesh();
00084 virtual ~IHWDrawMesh() { ; }
00086
00090 virtual void Draw(GraphicsWindow *gw, DWORD attribute) = 0;
00091
00093
00104 virtual void UpdateVertexBuffer(Point3 *vertexList,Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count,
00105 unsigned int *vertMapList, int *normalsMapList) = 0;
00106
00108 virtual void Release() = 0;
00109
00112 DllExport void MakeRef();
00113
00114
00115 protected:
00116
00117
00120 DllExport void DecRefCount();
00121
00122
00125 DllExport bool CanDelete();
00126
00127 int mRefCount;
00128
00129 };
00130
00132
00134 class IHWSubMesh : public MaxHeapOperators
00135 {
00136
00137 public:
00138 virtual ~IHWSubMesh() { }
00139
00141
00145 virtual void Draw(GraphicsWindow *gw, DWORD attribute) = 0;
00146
00148
00159 virtual void UpdateVertexBuffer(Point3 *vertexList,Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count,
00160 unsigned int *vertMapList, int *normalsMapList) = 0;
00161
00162
00163
00164 };
00165
00166
00167
00169
00173 class HWTupleMesh : public MaxHeapOperators
00174 {
00175 public:
00177
00180 DllExport HWTupleMesh(DWORD vertexType);
00181
00183 DllExport ~HWTupleMesh();
00184
00186 DllExport unsigned int Size();
00187
00189
00191 DllExport HWVertexBuffer* GetHWVertexBuffer();
00192
00194
00201 DllExport unsigned int AddHWIndexBuffer(unsigned int numberPrimitives, PrimitiveType primitive, bool use16Bit);
00202
00204 DllExport HWIndexBuffer* GetHWIndexBuffer(unsigned int id);
00205
00207 DllExport bool ReleaseHWIndexBuffer(unsigned int id);
00208
00210 DllExport unsigned int GetHWIndexCount();
00211
00213
00214 DllExport DWORD GetMatID();
00216
00217 DllExport void SetMatID(DWORD matID);
00218
00220
00221 DllExport void SetGFXMesh(IHWSubMesh *msh);
00223
00224 DllExport IHWSubMesh* GetGFXMesh();
00225
00227
00234 DllExport void UpdateVertexBuffer(Point3 *vertexList,Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count);
00235
00236
00237
00238
00239 private:
00240 DWORD mMatID;
00241 HWVertexBuffer *mHWVertexBuffer;
00242 Tab<HWIndexBuffer*> mPrimitives;
00243
00244
00245 IHWSubMesh *mHWDrawMesh;
00246
00247 };
00248
00249
00250
00252
00254 class HWTupleMeshContainer : public IHWDrawMesh
00255 {
00256 public:
00258 DllExport HWTupleMeshContainer();
00260 DllExport ~HWTupleMeshContainer();
00261
00263 DllExport void FreeMeshes();
00264
00266 DllExport unsigned int Count();
00268 DllExport GFX_MESH::HWTupleMesh *Get(unsigned int id);
00270
00273 DllExport void Append(GFX_MESH::HWTupleMesh *hwMesh);
00274
00275
00276
00278
00282 DllExport void Draw(GraphicsWindow *gw, DWORD attribute);
00283
00285
00296 DllExport void UpdateVertexBuffer(Point3 *vertexList,Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count,
00297 unsigned int *vertMapList, int *normalsMapList);
00298
00300 DllExport void Release();
00301
00302 private:
00303
00304 Tab<GFX_MESH::HWTupleMesh *> mHWTupleMesh;
00305 };
00306
00307
00308
00309
00310
00311 };