summaryrefslogtreecommitdiff
path: root/game/terrain.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-31 14:02:13 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-04 19:29:49 +0000
commit74a2cf310f4891e17157b508edb0ea982b03619e (patch)
tree662751c0249a57d3988d4c8a624e6c8882a6ea0e /game/terrain.h
parentCreate mesh direct from vertices and indices (diff)
downloadilt-74a2cf310f4891e17157b508edb0ea982b03619e.tar.bz2
ilt-74a2cf310f4891e17157b508edb0ea982b03619e.tar.xz
ilt-74a2cf310f4891e17157b508edb0ea982b03619e.zip
Create terrain as collection of meshes
Diffstat (limited to 'game/terrain.h')
-rw-r--r--game/terrain.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/game/terrain.h b/game/terrain.h
index 64c4f96..81ee128 100644
--- a/game/terrain.h
+++ b/game/terrain.h
@@ -1,13 +1,12 @@
#ifndef TERRAIN_H
#define TERRAIN_H
+#include "collection.hpp"
#include "worldobject.h"
-#include <GL/glew.h>
-#include <array>
+#include <gfx/models/mesh.h>
#include <gfx/models/vertex.hpp>
#include <gfx/renderable.h>
#include <memory>
-#include <special_members.hpp>
#include <string>
#include <vector>
@@ -18,9 +17,6 @@ class Terrain : public WorldObject, public Renderable {
public:
Terrain();
explicit Terrain(const std::string &);
- ~Terrain() override;
- NO_COPY(Terrain);
- NO_MOVE(Terrain);
void render(const Shader & shader) const override;
@@ -33,8 +29,7 @@ private:
Vertex & v(unsigned int width, unsigned int x, unsigned int z);
- GLuint m_vertexArrayObject;
- std::array<GLuint, NUM_BUFFERS> m_vertexArrayBuffers;
+ Collection<Mesh, false> meshes;
std::vector<Vertex> vertices;
std::vector<unsigned int> indices;
std::shared_ptr<Texture> texture;