833e2db7415556ca8216c88d0a5f73d5b00270dc
[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         /* used by draw_normals to debug stuff: */
22         mutable unsigned int nvao;
23         mutable unsigned int nvbo;
24
25 public:
26         MeshGL();
27         MeshGL(const MeshGL &mesh);
28         MeshGL& operator=(const MeshGL &mesh);
29
30         virtual ~MeshGL();
31
32         virtual void draw() const override;
33         virtual void draw_normals(float scale) const override;
34         virtual void update_vertex_data() override;
35
36         void destroy_vbo();
37 };
38
39 #endif // MESH_GL_H_