summaryrefslogtreecommitdiff
path: root/data/shaders/font-vertex.glsl
blob: 196da1209d6ad73fc4924bc8faca3c6f112b6923 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#version 120

uniform mat4 projection;
uniform vec2 position;
uniform vec2 anchor;

void main(void) {
    mat4 translation = mat4(1.0, 0.0, 0.0, position.x - anchor.x,
                            0.0, 1.0, 0.0, position.y - anchor.y,
                            0.0, 0.0, 1.0, 0.0,
                            0.0, 0.0, 0.0, 1.0);

    gl_Position = projection * (gl_Vertex * translation);
    gl_TexCoord[0] = gl_MultiTexCoord0;
}