2014-10-20 17:09:45 +00:00
|
|
|
#ifndef TERRAIN_HH_INCLUDED
|
|
|
|
#define TERRAIN_HH_INCLUDED
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "texture.hh"
|
2014-11-04 18:40:35 +00:00
|
|
|
#include <fstream>
|
2014-11-07 15:55:56 +00:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
|
2014-10-20 17:09:45 +00:00
|
|
|
|
|
|
|
class Terrain {
|
|
|
|
public:
|
2014-11-07 12:11:06 +00:00
|
|
|
Terrain(std::string filePath);
|
|
|
|
Terrain();
|
2014-10-20 17:09:45 +00:00
|
|
|
~Terrain();
|
|
|
|
void load();
|
|
|
|
void render();
|
|
|
|
private:
|
|
|
|
Texture texture;
|
|
|
|
std::string filePath;
|
2014-11-06 18:21:24 +00:00
|
|
|
unsigned int heightmapWidth, heightmapHeight;
|
2014-11-07 12:11:06 +00:00
|
|
|
float** heightmap; //can be accessed like 'float[][]'
|
2014-11-06 18:21:24 +00:00
|
|
|
bool heightmapChanged;
|
2014-11-07 12:11:06 +00:00
|
|
|
ACGL::OpenGL::SharedVertexArrayObject triangleMesh;
|
2014-11-06 18:21:24 +00:00
|
|
|
|
|
|
|
void makeTriangleMesh();
|
2014-10-20 17:09:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|