Saxum/terrain.hh

28 lines
610 B
C++
Raw Normal View History

2014-10-20 17:09:45 +00:00
#ifndef TERRAIN_HH_INCLUDED
#define TERRAIN_HH_INCLUDED
#include <string>
#include "material.hh"
#include <fstream>
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
2014-10-20 17:09:45 +00:00
class Terrain {
public:
Terrain(std::string filePath);
Terrain();
2014-10-20 17:09:45 +00:00
~Terrain();
void load();
void render();
private:
Material material;
2014-10-20 17:09:45 +00:00
std::string filePath;
unsigned int heightmapWidth, heightmapHeight;
float** heightmap; //can be accessed like 'float[][]'
bool heightmapChanged;
ACGL::OpenGL::SharedVertexArrayObject triangleMesh;
void makeTriangleMesh();
2014-10-20 17:09:45 +00:00
};
#endif