summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2023-04-22 22:54:17 -0700
committerkitty piapiac <kcp@bsd.computer>2023-04-22 22:54:17 -0700
commit5e9d27a6fedfe964ea68fa5bd6cc84ba244a01fb (patch)
tree29073bfc65b711aeb4a9ae27677d4fbcfadfa232 /graph.c
parent8f38659932677a2b0e00b7f4abda54ac76a8ecd9 (diff)
add grid + baking held piece into grid
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c5
1 files changed, 4 insertions, 1 deletions
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;