summaryrefslogtreecommitdiff
path: root/game/terrain.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-01-02 18:04:00 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-01-02 18:04:00 +0000
commitc2421c3ac2018faf5d47205ee979acec181d9672 (patch)
tree53651bfd3e5839c8334862f311466041da5f4d91 /game/terrain.h
parentUse Cache system to persist font rendering for Text (diff)
downloadilt-c2421c3ac2018faf5d47205ee979acec181d9672.tar.bz2
ilt-c2421c3ac2018faf5d47205ee979acec181d9672.tar.xz
ilt-c2421c3ac2018faf5d47205ee979acec181d9672.zip
Separate geographic data (GeoData) from its visual representation(s) (Terrain)
Diffstat (limited to 'game/terrain.h')
-rw-r--r--game/terrain.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/game/terrain.h b/game/terrain.h
index c32f092..4775dff 100644
--- a/game/terrain.h
+++ b/game/terrain.h
@@ -7,17 +7,14 @@
#include <gfx/models/mesh.h>
#include <gfx/renderable.h>
#include <memory>
-#include <string>
-#include <vector>
class Shader;
class Texture;
-class Vertex;
+class GeoData;
class Terrain : public WorldObject, public Renderable {
public:
- Terrain();
- explicit Terrain(const std::string &);
+ explicit Terrain(std::shared_ptr<GeoData>);
void render(const Shader & shader) const override;
@@ -25,10 +22,9 @@ public:
float waveCycle {0.F};
private:
- static constexpr unsigned int NUM_BUFFERS {4};
-
- void finish(unsigned int width, unsigned int height, std::vector<Vertex> &);
+ void generateMeshes();
+ std::shared_ptr<GeoData> geoData;
Collection<Mesh, false> meshes;
std::shared_ptr<Texture> grass, water;
};