From 5e9d27a6fedfe964ea68fa5bd6cc84ba244a01fb Mon Sep 17 00:00:00 2001 From: kitty piapiac Date: Sat, 22 Apr 2023 22:54:17 -0700 Subject: add grid + baking held piece into grid --- graph.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graph.c') diff --git a/graph.c b/graph.c index 05c22bf..52898cb 100644 --- a/graph.c +++ b/graph.c @@ -26,6 +26,8 @@ V graph_init(V){SDL_version sdl_vh,sdl_vl; N(ctx=SDL_GL_CreateContext(win),on_err("create OpenGL context")) N(gladLoadGLLoader(SDL_GL_GetProcAddress),on_err("load GL")) SDL_GL_SetSwapInterval(1), + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA), + glEnable(GL_BLEND), q_init(); SDL_VERSION(&sdl_vh)SDL_GetVersion(&sdl_vl); fprintf(stderr, @@ -93,7 +95,8 @@ U32 graph_shader_create(IM C*vert,IM C*frag){I ok;C info[512];U32 v,f,p; V graph_shader_use(U32 s){glUseProgram(s);} V graph_shader_setI(IM C*s,I i) {I p;glGetIntegerv(GL_CURRENT_PROGRAM,&p),glUniform1i(glGetUniformLocation(p,s),i);} -V graph_shader_setV3(IM C*s,vec3 v3){I p;glGetIntegerv(GL_CURRENT_PROGRAM,&p),glUniform3f(glGetUniformLocation(p,s),v3[0],v3[1],v3[2]);} +V graph_shader_setV3(IM C*s,vec3 v3){I p;glGetIntegerv(GL_CURRENT_PROGRAM,&p),glUniform3fv(glGetUniformLocation(p,s),1,v3);} +V graph_shader_setV4(IM C*s,vec4 v4){I p;glGetIntegerv(GL_CURRENT_PROGRAM,&p),glUniform4fv(glGetUniformLocation(p,s),1,v4);} V graph_shader_setM4(IM C*s,mat4 m4){I p;glGetIntegerv(GL_CURRENT_PROGRAM,&p),glUniformMatrix4fv(glGetUniformLocation(p,s),1,GL_FALSE,&m4[0][0]);} U32 graph_tex_create(IM C*f){Tex tex;U32 t; -- cgit v1.2.3