diff options
author | kitty piapiac <kcp@bsd.computer> | 2023-04-21 23:50:06 -0700 |
---|---|---|
committer | kitty piapiac <kcp@bsd.computer> | 2023-04-21 23:50:06 -0700 |
commit | 8f38659932677a2b0e00b7f4abda54ac76a8ecd9 (patch) | |
tree | 705767e858a3fe0c89b7b4bc0440012a084c6921 /scene-title.c | |
parent | 599cde356b576759475d34dbfadb5548926c089d (diff) |
SRS-style rotation skeleton
Diffstat (limited to 'scene-title.c')
-rw-r--r-- | scene-title.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/scene-title.c b/scene-title.c deleted file mode 100644 index 527c686..0000000 --- a/scene-title.c +++ /dev/null @@ -1,51 +0,0 @@ -/*2d title screen*/ - -#include<cglm/affine.h> -#include<cglm/cglm.h> -#include"mino.h" -#include"graph.h" -#include"scene.h" -#include"input.h" - -_ mat4 win_proj; - -_ U32 shader_tex; -_ IM C shader_tex_vert[]=GRAPH_GLSL( - layout (location=0) in vec3 pos; - layout (location=1) in vec3 col; - layout (location=2) in vec2 tex; - out vec3 Col; - out vec2 Tex; - uniform mat4 proj; - uniform mat4 model; - void main(){gl_Position=proj*model*vec4(pos,1.0);Col=col;Tex=tex;}); -_ IM C shader_tex_frag[]=GRAPH_GLSL( - out vec4 Frag; - in vec3 Col; - in vec2 Tex; - uniform sampler2D buf; - void main(){Frag=texture(buf,Tex);}); -_ V shader_tex_init(V){ - shader_tex=graph_shader_create(shader_tex_vert,shader_tex_frag), - graph_shader_use(shader_tex), - graph_shader_setM4("proj",win_proj), - graph_shader_setI("buf",0);} - -_ U32 tex_cat; -_ V title_init(V){ - glm_ortho(0,graph_win_w,0,graph_win_h,0,4,win_proj), - shader_tex_init(); - tex_cat=graph_tex_create("res/tex/cat.jpg");} - -_ V title_loop(V){/*prelude*/graph_before(),graph_events();InputPoint p; - glm_ortho(0,graph_win_w,0,graph_win_h,0,4,win_proj), - /*interlude*/ - p=input_point(), - graph_shader_use(shader_tex),graph_shader_setM4("proj",win_proj), - graph_tex_use(tex_cat,0), - graph_quad_xywh(p.x,p.y,256,256), - /*postlude*/ - graph_after();} - -_ Scene*title_run(V){title_init();WH(1,title_loop());R 0;} -Scene scene_title={"title",title_run}; |