#pragma once #include #include namespace renderer { class Shader { public: Shader(); ~Shader(); bool fromSource( const std::string& vertexSrc, const std::string& fragmentSrc ); bool fromFiles( const std::string& vertexPath, const std::string& fragmentPath ); void use() const; unsigned int id() const; void setInt( const std::string& name, int value ) const; void setFloat( const std::string& name, float value ) const; void setVec3( const std::string& name, const glm::vec3& v ) const; void setVec2( const std::string& name, const glm::vec2& v ) const; void setMat4( const std::string& name, const glm::mat4& m ) const; private: unsigned int mID; bool compileShader( const char* vSrc, const char* fSrc ); std::string readFile( const std::string& path ) const; }; } // namespace renderer