#ifndef OPENGLSHADERPROGRAM_H #define OPENGLSHADERPROGRAM_H #include "opengl_global.h" #include #include #include #include #include class QOpenGLShaderProgram; class QOpenGLFunctions_3_2_Core; namespace paysages { namespace opengl { class OPENGLSHARED_EXPORT OpenGLShaderProgram { public: OpenGLShaderProgram(QString name, QOpenGLFunctions_3_2_Core* functions); ~OpenGLShaderProgram(); void addVertexSource(QString path); void addFragmentSource(QString path); void compile(); void updateCamera(const QVector3D& location, const QMatrix4x4& view); void updateWaterHeight(double height); void updateSun(const QVector3D& direction, const QColor& color); void addTexture(QString sampler_name, Texture2D* texture); void addTexture(QString sampler_name, Texture3D* texture); void addTexture(QString sampler_name, Texture4D* texture); void drawTriangles(float* vertices, int triangle_count); void drawTriangleStrip(float* vertices, int vertex_count); private: void bind(); void release(); QMatrix4x4 view; QVector3D camera_location; float water_height; QVector3D sun_direction; QColor sun_color; QString name; QOpenGLShaderProgram* program; QOpenGLFunctions_3_2_Core* functions; QMap > textures; }; } } #endif // OPENGLSHADERPROGRAM_H