super basic UI constraint and alignment system with a super basic "game framework"

This commit is contained in:
2023-12-11 23:00:31 +02:00
committed by Illusion
parent 129e038c19
commit 3ab33f3f84
20 changed files with 989 additions and 414 deletions
+2 -2
View File
@@ -3,9 +3,9 @@ in vec2 TexCoords;
out vec4 FragColor;
uniform sampler2D text;
uniform vec3 textColor;
uniform vec4 textColor;
void main() {
vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, TexCoords).r);
FragColor = vec4(textColor, 1.0) * sampled;
FragColor = textColor * sampled;
}
+3 -2
View File
@@ -2,9 +2,10 @@
layout (location = 0) in vec4 vertex;
out vec2 TexCoords;
uniform mat4 transform;
uniform mat4 projection;
uniform mat4 model;
void main() {
gl_Position = transform * vec4(vertex.xy, 0.0, 1.0);
gl_Position = projection * model * vec4(vertex.xy, 0.0, 1.0);
TexCoords = vertex.zw;
}
+9
View File
@@ -0,0 +1,9 @@
#version 330 core
in vec2 texCoords;
out vec4 FragColor;
uniform vec4 aColor;
void main() {
FragColor = vec4(aColor);
}
+11
View File
@@ -0,0 +1,11 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoords;
out vec2 texCoords;
uniform mat4 projection;
void main() {
gl_Position = projection * vec4(aPos, 1.0f);
texCoords = aTexCoords;
}