2013-12-21 23:41:19 +00:00
|
|
|
#ifndef OPENGLWATER_H
|
|
|
|
#define OPENGLWATER_H
|
|
|
|
|
|
|
|
#include "opengl_global.h"
|
|
|
|
|
|
|
|
#include "OpenGLPart.h"
|
2015-08-17 20:55:30 +00:00
|
|
|
#include "DefinitionWatcher.h"
|
2013-12-21 23:41:19 +00:00
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace opengl {
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
class OPENGLSHARED_EXPORT OpenGLWater : public OpenGLPart, public DefinitionWatcher {
|
|
|
|
public:
|
|
|
|
OpenGLWater(OpenGLRenderer *renderer);
|
2013-12-21 23:41:19 +00:00
|
|
|
virtual ~OpenGLWater();
|
|
|
|
|
|
|
|
virtual void initialize() override;
|
|
|
|
virtual void update() override;
|
|
|
|
virtual void render() override;
|
|
|
|
|
2015-08-17 20:55:30 +00:00
|
|
|
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff) override;
|
2015-08-20 22:25:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable or disable the water surface rendering.
|
|
|
|
*/
|
|
|
|
void setEnabled(bool enabled);
|
2015-11-09 21:30:46 +00:00
|
|
|
|
|
|
|
private:
|
2013-12-21 23:41:19 +00:00
|
|
|
void setVertex(int i, float x, float y, float z);
|
|
|
|
|
2015-08-20 22:25:34 +00:00
|
|
|
bool enabled;
|
2015-11-09 21:30:46 +00:00
|
|
|
OpenGLShaderProgram *program;
|
|
|
|
float *vertices;
|
2013-12-21 23:41:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // OPENGLWATER_H
|