feat: add font class and render font function

This commit is contained in:
2026-03-28 12:04:31 +08:00
parent 93fbbaca2b
commit c37c45ad19
10 changed files with 217 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
#version 460
in vec2 texCoord;
out vec4 color;
layout (binding = 0) uniform sampler2D text;
uniform vec3 textColor;
void main(void) {
vec4 smapled = vec4(1.0, 1.0, 1.0, texture(text, texCoord).r);
color = vec4(textColor, 1.0) * smapled;
}

View File

@@ -0,0 +1,11 @@
#version 460
layout (location = 0) in vec4 vertex;
out vec2 texCoord;
uniform mat4 projection;
void main(void) {
gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
texCoord = vec2(vertex.zw);
}