2009-05-03 12:05:03 +01:00
|
|
|
|
2009-05-08 10:04:53 +01:00
|
|
|
#include <vector>
|
2009-05-03 12:05:03 +01:00
|
|
|
|
|
|
|
struct cube
|
|
|
|
{
|
2009-05-08 10:04:53 +01:00
|
|
|
std::vector<int> index_list; // probably always .size() == 10...
|
2009-05-03 12:05:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct quad_strip
|
|
|
|
{
|
2009-05-08 10:04:53 +01:00
|
|
|
std::vector<int> index_list;
|
2009-05-03 12:05:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct fan
|
|
|
|
{
|
2009-05-08 10:04:53 +01:00
|
|
|
std::vector<int> index_list;
|
2009-05-03 12:05:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CMesh
|
|
|
|
{
|
|
|
|
public:
|
2009-05-08 10:04:53 +01:00
|
|
|
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;
|
2009-05-03 12:05:03 +01:00
|
|
|
|
2009-05-08 10:04:53 +01:00
|
|
|
void VertexAdd (const GLvertex& v);
|
|
|
|
int VertexCount () { return _vertex.size(); }
|
2009-05-03 12:05:03 +01:00
|
|
|
int PolyCount () { return _polycount; }
|
2009-05-08 10:04:53 +01:00
|
|
|
void CubeAdd (const cube& c);
|
|
|
|
void QuadStripAdd (const quad_strip& qs);
|
|
|
|
void FanAdd (const fan& f);
|
2009-05-03 12:05:03 +01:00
|
|
|
void Render ();
|
|
|
|
void Compile ();
|
|
|
|
|
|
|
|
};
|