#ifndef SHADER_HPP #define SHADER_HPP #include // include glad to get all the required OpenGL headers #include #include #include #include class Shader { public: // the program ID unsigned int ID; // constructor reads and builds the shader Shader(const std::string vertexPath, const std::string fragmentPath); // use/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: unsigned int linkShaderObjectsShaderProgram(const unsigned int vertexShaders, const unsigned int fragmentShader) const; const char* readFile(const std::string fileName) const; std::pair compileShaders(const char* vertexShaderSource, const char* fragmentShaderSource) const; unsigned int compileShader(const GLenum shaderType, const char *shaderSource) const; int shaderSuccessful(const unsigned int shader, const bool compilation) const; void shaderFailedMessage(const unsigned int shader, const bool compilation) const; }; #endif