summaryrefslogtreecommitdiff
path: root/game/terrain.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/terrain.h')
-rw-r--r--game/terrain.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/game/terrain.h b/game/terrain.h
new file mode 100644
index 0000000..4db99c5
--- /dev/null
+++ b/game/terrain.h
@@ -0,0 +1,37 @@
+#ifndef TERRAIN_H
+#define TERRAIN_H
+
+#include "worldobject.h"
+#include <GL/glew.h>
+#include <array>
+#include <gfx/models/vertex.hpp>
+#include <gfx/renderable.h>
+#include <memory>
+#include <special_members.hpp>
+#include <vector>
+
+class Shader;
+class Texture;
+
+class Terrain : public WorldObject, public Renderable {
+public:
+ Terrain();
+ ~Terrain() override;
+ NO_COPY(Terrain);
+ NO_MOVE(Terrain);
+
+ void render(const Shader & shader) const override;
+
+ void tick(TickDuration) override { }
+
+private:
+ static constexpr unsigned int NUM_BUFFERS {4};
+
+ GLuint m_vertexArrayObject;
+ std::array<GLuint, NUM_BUFFERS> m_vertexArrayBuffers;
+ std::vector<Vertex> vertices;
+ std::vector<unsigned int> indices;
+ std::shared_ptr<Texture> texture;
+};
+
+#endif