Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
voxelmesh.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <GL/glew.h>
6 
7 #include <glow/ref_ptr.h>
8 
9 #include <glm/glm.hpp>
10 
11 #include "etc/contextdependant.h"
12 
13 
14 namespace glow {
15  class Program;
16  class VertexArrayObject;
17  class Buffer;
18 };
19 
20 
21 class VoxelMesh : public ContextDependant {
22 public:
23  VoxelMesh();
24  void bindTo(glow::Program* program,
25  glow::VertexArrayObject* vao,
26  int bindingIndex);
27 
28 protected:
29  bool m_initialized;
30  glow::ref_ptr<glow::Buffer> m_vertexBuffer;
31 
32  void setupVertexAttribute(glow::Program* program, glow::VertexArrayObject* vao, const std::string& name, GLboolean normalised, int bindingNum, GLint offset);
33 
34  void initialize();
35 
36  virtual void beforeContextDestroy() override;
37  virtual void afterContextRebuild() override;
38 };
39 
Definition: contextdependant.h:7
Definition: voxelmesh.h:21