36 lines
716 B
C++
36 lines
716 B
C++
#ifndef GLTEST_MESH_H
|
|
#define GLTEST_MESH_H
|
|
|
|
#include "vertex.h"
|
|
#include "../Shaders/ShaderProgram.h"
|
|
#include "GLObject.h"
|
|
|
|
#include <cstddef>
|
|
#include <GL/glew.h>
|
|
#include <glm/glm.hpp>
|
|
#include <vector>
|
|
|
|
|
|
class Mesh: public GLObject {
|
|
protected:
|
|
size_t _size;
|
|
std::vector<float> _xs;
|
|
std::vector<float> _ys;
|
|
|
|
public:
|
|
Mesh(ShaderProgram* shader, std::size_t size);
|
|
virtual ~Mesh();
|
|
|
|
protected:
|
|
void generateVertices() const override final;
|
|
void updateVertices() const override final;
|
|
void generateIndices() const override final;
|
|
|
|
protected:
|
|
virtual float heightMap(std::size_t nx, std::size_t ny) const = 0;
|
|
virtual float heightMap(float fx, float fy) const = 0;
|
|
};
|
|
|
|
|
|
#endif //GLTEST_MESH_H
|