#ifndef SHADER_H #define SHADER_H #include "math/Vector.h" #include "utils/Error.h" #include "utils/List.h" #include "wrapper/GL.h" class Shader final { GL::Shader vertex; GL::Shader geometry; GL::Shader fragment; GL::Program program; public: Shader(); ~Shader(); Shader(const Shader& other) = delete; Shader(Shader&& other) = delete; Shader& operator=(const Shader& other) = delete; Shader& operator=(Shader&& other) = delete; Error compile(const char* vertexPath, const char* geometryPath, const char* fragmentPath); void use() const; void setMatrix(const char* name, const float* data); void setInt(const char* name, int data); void setFloat(const char* name, float data); void setVector(const char* name, const Vector2& v); void setVector(const char* name, const Vector3& v); void setVector(const char* name, const Vector4& v); private: Error compile(const char* path, GL::Shader& s, GL::ShaderType st); Error readFile(List& code, const char* path) const; Error compile(GL::Shader& s, const List& code, GL::ShaderType st); }; #endif