#ifndef SHADER_HPP #define SHADER_HPP #include #include #include #include #include class Shader { public: unsigned int ID; // constructor generates the shader on the fly // ------------------------------------------------------------------------ Shader(const std::string vertexPath, const std::string fragmentPath); const std::string fileToShader(const std::string shaderPath); // activate the shader // ------------------------------------------------------------------------ void use(); // utility uniform functions // ------------------------------------------------------------------------ void setBool(const std::string &name, bool value) const; // ------------------------------------------------------------------------ void setInt(const std::string &name, int value) const; // ------------------------------------------------------------------------ void setFloat(const std::string &name, float value) const; private: // utility function for checking shader compilation/linking errors. // ------------------------------------------------------------------------ void checkCompileErrors(unsigned int shader, std::string type); void compileErrorsMessage(const unsigned int shader, const bool compilation, const std::string type, const std::string errorMessage); }; #endif