#include "uiShader.h" #include "gl_traits.h" #include #include #include #include #include #include #include #include UIShader::IconProgram::IconProgram(const glm::mat4 & vp) : UIProgram {vp, uiShader_vs, uiShader_fs} { } UIShader::TextProgram::TextProgram(const glm::mat4 & vp) : UIProgram {vp, uiShader_vs, uiShaderFont_fs}, colorLoc {*this, "colour"} { } UIShader::UIShader(size_t width, size_t height) : UIShader {glm::ortho(0, static_cast(width), 0, static_cast(height))} { } UIShader::UIShader(const glm::mat4 & viewProjection) : icon {viewProjection}, text {viewProjection} { } void UIShader::TextProgram::use(const RGB & colour) const { Program::use(); glUniform(colorLoc, colour); }