fixed mesh bugs
[demo] / src / opengl / mesh-gl.h
1 #ifndef MESH_GL_H_
2 #define MESH_GL_H_
3
4 #include "mesh.h"
5
6 class MeshGL : public Mesh {
7 private:
8         unsigned int vao;
9
10         unsigned int vbo_vertices;
11         unsigned int vbo_normals;
12         unsigned int vbo_tex_coords;
13
14         unsigned int ibo;
15
16         int num_vertices;
17         int num_indices;
18
19         void update_vbo();
20
21 protected:
22         virtual void update_vertex_data() override;
23
24 public:
25         MeshGL();
26         MeshGL(const MeshGL &mesh);
27         MeshGL& operator=(const MeshGL &mesh);
28
29         virtual ~MeshGL();
30
31         virtual void draw() const override;
32
33         void destroy_vbo();
34 };
35
36 #endif // MESH_GL_H_