summaryrefslogtreecommitdiff
path: root/game/terrain.h
blob: 2cec96311e8ec7a7d3e5f6b194afe8a3cef729e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef TERRAIN_H
#define TERRAIN_H

#include "collection.hpp"
#include "worldobject.h"
#include <gfx/models/mesh.h>
#include <gfx/models/vertex.hpp>
#include <gfx/renderable.h>
#include <memory>
#include <string>
#include <vector>

class Shader;
class Texture;

class Terrain : public WorldObject, public Renderable {
public:
	Terrain();
	explicit Terrain(const std::string &);

	void render(const Shader & shader) const override;

	void tick(TickDuration) override;
	float waveCycle {0.F};

private:
	static constexpr unsigned int NUM_BUFFERS {4};

	void finish(unsigned int width, unsigned int height, std::vector<Vertex> &);

	Collection<Mesh, false> meshes;
	std::shared_ptr<Texture> grass, water;
};

#endif