paysages3d/src/render/opengl/OpenGLTerrain.h
Michaël Lemaire 8fa0d8af29 Added DefinitionWatcher system
Also switched to the new definition system for /terrain/water_height
2015-08-17 22:55:30 +02:00

50 lines
1,017 B
C++

#ifndef OPENGLTERRAIN_H
#define OPENGLTERRAIN_H
#include "opengl_global.h"
#include "OpenGLPart.h"
#include "DefinitionWatcher.h"
#include <QVector>
#include <QList>
#include <QMutex>
namespace paysages {
namespace opengl {
class OPENGLSHARED_EXPORT OpenGLTerrain: public OpenGLPart, public DefinitionWatcher
{
public:
OpenGLTerrain(OpenGLRenderer* renderer);
virtual ~OpenGLTerrain();
virtual void initialize() override;
virtual void update() override;
virtual void render() override;
virtual void interrupt() override;
/**
* Reset the color textures, without changing the tessellation.
*/
void resetTextures();
void performChunksMaintenance();
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff) override;
private:
OpenGLShaderProgram* program;
ParallelPool* work;
QVector<ExplorerChunkTerrain*> _chunks;
QList<ExplorerChunkTerrain*> _updateQueue;
QMutex _lock_chunks;
};
}
}
#endif // OPENGLTERRAIN_H