quick backup of the renderer - things missing
[demo] / src / mesh.h
1 #ifndef MESH_H_
2 #define MESH_H_
3
4 #include <stdint.h>
5 #include <string>
6 #include <vector>
7 #include <gmath/gmath.h>
8
9 enum {
10         MESH_VERTEX = 1,
11         MESH_NORMAL = 2,
12         MESH_TEXTURE = 3,
13         MESH_INDEX = 4,
14         MESH_TANGENT = 5
15 };
16
17 class Mesh {
18 private:
19         // call before draw in gl
20         virtual void update_vertex_data() = 0;
21 public:
22         std::vector<uint16_t> indices;
23         std::vector<Vec3> vertices;
24         std::vector<Vec3> normals;
25         std::vector<Vec3> tangents;
26         std::vector<Vec2> tex_coords;
27
28         std::string name;
29         unsigned int mat_idx;
30
31
32         Mesh();
33         virtual ~Mesh() = 0;
34
35         virtual void draw() const = 0;
36 };
37
38 #endif // MESH_H_