#pragma once #include "GlLoader.hpp" #include class Mat44; class Vec3; class Shader { public: Shader(std::string const& vertexPath, std::string const& fragmentPath); void Activate(); template void SetUniform(const std::string& name, const T& value) { if constexpr (std::is_same_v) { glUniformMatrix4fv(glGetUniformLocation(mId, name.c_str()), 1, GL_TRUE, (GLfloat*)value.m); } else if constexpr (std::is_same_v) { glUniform3fv(glGetUniformLocation(mId, name.c_str()), 1, (GLfloat*)&value); } } private: GLuint mId; };