Saxum/game/terrain.hh

31 lines
833 B
C++
Raw Permalink 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 <ACGL/OpenGL/Objects/VertexArrayObject.hh>
#include "model.hh"
using namespace ACGL::OpenGL;
2014-10-20 17:09:45 +00:00
class Terrain {
public:
Terrain(std::string heightmapFilePath);
Terrain();
2014-10-20 17:09:45 +00:00
~Terrain();
void load();
void render();
float** getHeightmap();
int getHeightmapHeight();
int getHeightmapWidth();
SharedVertexArrayObject makeTriangleMesh(int startX, int startZ, int endX, int endZ);
2014-10-20 17:09:45 +00:00
private:
Material material;
std::string heightmapFilePath;
int heightmapHeight, heightmapWidth;
float** heightmap; //can be accessed like 'float[][]'
void set_abData(float* abData, int dataCount, int rowNum, int columnNum);
2014-10-20 17:09:45 +00:00
};
#endif