Add game framework and whitebox level

This commit is contained in:
2026-06-08 23:47:32 +08:00
parent 5525343656
commit e52cf94336
24 changed files with 778 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

+8
View File
@@ -0,0 +1,8 @@
#version 330 core
in vec4 v_color;
out vec4 FragColor;
void main() {
FragColor = v_color;
}
+14
View File
@@ -0,0 +1,14 @@
#version 330 core
layout (location = 0) in vec2 a_position;
layout (location = 1) in vec2 a_texCoord;
layout (location = 2) in vec4 a_color;
uniform mat4 u_view;
uniform mat4 u_projection;
out vec4 v_color;
void main() {
v_color = a_color;
gl_Position = u_projection * u_view * vec4(a_position, 0.0, 1.0);
}
+12
View File
@@ -0,0 +1,12 @@
{
"shaders": {
"sprite": {
"vertex": "sprite.vert",
"fragment": "sprite.frag"
},
"colored_quad": {
"vertex": "colored_quad.vert",
"fragment": "colored_quad.frag"
}
}
}
+11
View File
@@ -0,0 +1,11 @@
#version 330 core
in vec2 v_texCoord;
in vec4 v_color;
uniform sampler2D u_texture;
out vec4 FragColor;
void main() {
FragColor = texture(u_texture, v_texCoord) * v_color;
}
+16
View File
@@ -0,0 +1,16 @@
#version 330 core
layout (location = 0) in vec2 a_position;
layout (location = 1) in vec2 a_texCoord;
layout (location = 2) in vec4 a_color;
uniform mat4 u_view;
uniform mat4 u_projection;
out vec2 v_texCoord;
out vec4 v_color;
void main() {
v_texCoord = a_texCoord;
v_color = a_color;
gl_Position = u_projection * u_view * vec4(a_position, 0.0, 1.0);
}