mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 07:50:04 +00:00
Create a text shader and font utility
This commit is contained in:
parent
817a59f741
commit
82b265b6d4
11 changed files with 473 additions and 5 deletions
12
scwx-qt/gl/text.frag
Normal file
12
scwx-qt/gl/text.frag
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#version 330 core
|
||||
in vec2 texCoords;
|
||||
out vec4 color;
|
||||
|
||||
uniform sampler2D text;
|
||||
uniform vec4 textColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 sampled = vec4(1.0f, 1.0f, 1.0f, texture(text, texCoords).r);
|
||||
color = textColor * sampled;
|
||||
}
|
||||
11
scwx-qt/gl/text.vert
Normal file
11
scwx-qt/gl/text.vert
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#version 330 core
|
||||
layout (location = 0) in vec4 vertex;
|
||||
out vec2 texCoords;
|
||||
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * vec4(vertex.xy, 0.0f, 1.0f);
|
||||
texCoords = vertex.zw;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue