]> git.sur5r.net Git - fstl/blob - src/mesh.h
9e2ab0c96c3ce3f8231b63f52964233a11ff86c5
[fstl] / src / mesh.h
1 #ifndef MESH_H
2 #define MESH_H
3
4 #include <QString>
5 #include <QtOpenGL/QtOpenGL>
6
7 #include <vector>
8
9 class Mesh
10 {
11 public:
12     Mesh(std::vector<GLfloat>&& vertices, std::vector<GLuint>&& indices);
13
14     float min(size_t start) const;
15     float max(size_t start) const;
16
17     float xmin() const { return min(0); }
18     float ymin() const { return min(1); }
19     float zmin() const { return min(2); }
20     float xmax() const { return max(0); }
21     float ymax() const { return max(1); }
22     float zmax() const { return max(2); }
23
24     int triCount() const;
25     bool empty() const;
26
27 private:
28     std::vector<GLfloat> vertices;
29     std::vector<GLuint> indices;
30
31     friend class GLMesh;
32 };
33
34 #endif // MESH_H