refactor: 重构项目结构和资源管理
- 将主程序代码和资源文件移动到Game目录下 - 更新构建脚本以适配新的目录结构 - 重构应用初始化流程,移除冗余代码 - 更新着色器文件路径和资源管理逻辑 - 删除废弃的windows.lua构建脚本 - 优化Switch平台构建配置
This commit is contained in:
9
Game/shaders/colored_quad.frag
Normal file
9
Game/shaders/colored_quad.frag
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
varying vec4 v_color;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = v_color;
|
||||
}
|
||||
19
Game/shaders/colored_quad.vert
Normal file
19
Game/shaders/colored_quad.vert
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
attribute vec2 a_position;
|
||||
attribute vec2 a_texCoord;
|
||||
attribute vec4 a_color;
|
||||
|
||||
uniform mat4 u_view;
|
||||
uniform mat4 u_projection;
|
||||
|
||||
varying vec2 v_texCoord;
|
||||
varying vec4 v_color;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_projection * u_view * vec4(a_position, 0.0, 1.0);
|
||||
v_texCoord = a_texCoord;
|
||||
v_color = a_color;
|
||||
}
|
||||
13
Game/shaders/sprite.frag
Normal file
13
Game/shaders/sprite.frag
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
varying vec2 v_texCoord;
|
||||
varying vec4 v_color;
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
|
||||
void main() {
|
||||
vec4 texColor = texture2D(u_texture, v_texCoord);
|
||||
gl_FragColor = texColor * v_color;
|
||||
}
|
||||
20
Game/shaders/sprite.vert
Normal file
20
Game/shaders/sprite.vert
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
attribute vec2 a_position;
|
||||
attribute vec2 a_texCoord;
|
||||
attribute vec4 a_color;
|
||||
|
||||
uniform mat4 u_view;
|
||||
uniform mat4 u_projection;
|
||||
uniform sampler2D u_texture;
|
||||
|
||||
varying vec2 v_texCoord;
|
||||
varying vec4 v_color;
|
||||
|
||||
void main() {
|
||||
gl_Position = u_projection * u_view * vec4(a_position, 0.0, 1.0);
|
||||
v_texCoord = a_texCoord;
|
||||
v_color = a_color;
|
||||
}
|
||||
Reference in New Issue
Block a user