-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeshFactory.h
51 lines (39 loc) · 888 Bytes
/
MeshFactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <D3DX11.h>
#include <map>
class LODMesh
{
public:
struct MeshVertex
{
D3DXVECTOR3 Pos;
};
public:
int m_Level;
int m_MeshDim;
int m_VertexNum;
int m_IndexNum;
int m_FaceNum;
ID3D11Buffer* m_pMeshVB ;
ID3D11Buffer* m_pMeshIB ;
D3DXVECTOR3 m_ModelTrans;
public:
LODMesh( int lod );
~LODMesh();
inline ID3D11Buffer* GetIndexBuffer() {return m_pMeshIB;}
inline ID3D11Buffer* GetVertexBuffer() { return m_pMeshVB; }
inline int GetIndexNum() { return m_IndexNum; }
inline int GetVertexSize() { return sizeof(MeshVertex); }
HRESULT Init(ID3D11Device* pd3dDevice);
void Release();
};
class MeshFactory
{
public:
MeshFactory(void);
~MeshFactory(void);
LODMesh* GetLevelMesh( int level );
void Release();
private:
std::map<int, LODMesh*> MeshStorage;
};