forked from skeeto/pixelcity
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Mesh.h
41 lines (34 loc) · 929 Bytes
/
Mesh.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
#include <vector>
struct cube
{
std::vector<int> index_list; // probably always .size() == 10...
};
struct quad_strip
{
std::vector<int> index_list;
};
struct fan
{
std::vector<int> index_list;
};
class CMesh
{
public:
CMesh ();
~CMesh ();
unsigned _list;
int _polycount;
std::vector<GLvertex> _vertex;
std::vector<cube> _cube;
std::vector<quad_strip> _quad_strip;
std::vector<fan> _fan;
bool _compiled;
void VertexAdd (const GLvertex& v);
int VertexCount () { return _vertex.size(); }
int PolyCount () { return _polycount; }
void CubeAdd (const cube& c);
void QuadStripAdd (const quad_strip& qs);
void FanAdd (const fan& f);
void Render ();
void Compile ();
};