blob: 23da9dc28cb83ce00632d1c3f4e7fa97c0b6551f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "uiShader.h"
#include "gl_traits.h"
#include <gfx/gl/program.h>
#include <gfx/gl/shader.h>
#include <gfx/gl/shaders/fs-uiShader.h>
#include <gfx/gl/shaders/fs-uiShaderFont.h>
#include <gfx/gl/shaders/vs-uiShader.h>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
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} { }
UIShader::UIShader(size_t width, size_t height) :
UIShader {glm::ortho<float>(0, static_cast<float>(width), 0, static_cast<float>(height))}
{
}
UIShader::UIShader(const glm::mat4 & viewProjection) : icon {viewProjection}, text {viewProjection} { }
void
UIShader::TextProgram::use(const RGB & colour) const
{
Program::use();
glUniform(colorLoc, colour);
}
|