#ifndef TERRAIN_H #define TERRAIN_H #include "worldobject.h" #include #include #include #include #include #include #include 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}; void finish(unsigned int width, unsigned int height, unsigned int resolution); Vertex & v(unsigned int width, unsigned int x, unsigned int z); GLuint m_vertexArrayObject; std::array m_vertexArrayBuffers; std::vector vertices; std::vector indices; std::shared_ptr texture; }; #endif