text drawing using freetype

This commit is contained in:
2023-09-12 03:21:54 +02:00
parent 6f70018892
commit 41d28a222c
18 changed files with 697 additions and 50 deletions
+11
View File
@@ -0,0 +1,11 @@
#version 330 core
in vec2 TexCoords;
out vec4 FragColor;
uniform sampler2D text;
uniform vec3 textColor;
void main() {
vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, TexCoords).r);
FragColor = vec4(textColor, 1.0) * sampled;
}
+10
View File
@@ -0,0 +1,10 @@
#version 330 core
layout (location = 0) in vec4 vertex;
out vec2 TexCoords;
uniform mat4 transform;
void main() {
gl_Position = transform * vec4(vertex.xy, 0.0, 1.0);
TexCoords = vertex.zw;
}
@@ -47,3 +47,4 @@ void main()
FragColor = vec4(240.f/255.f, 235.f/255.f, 227.f/255.f, 1.0);
}
}