From 5393ce93d05f9979b7882c686b241f6738011c64 Mon Sep 17 00:00:00 2001 From: kitty piapiac Date: Mon, 17 Apr 2023 23:46:30 -0700 Subject: mat4 transformations --- graph.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'graph.c') diff --git a/graph.c b/graph.c index 92316c3..4e025c9 100644 --- a/graph.c +++ b/graph.c @@ -2,6 +2,7 @@ #include #define SDL_MAIN_HANDLED #include +#include #include"mino.h" #include"graph.h" #include"tex.h" @@ -46,6 +47,8 @@ V graph_deinit(V){SDL_GL_DeleteContext(ctx),SDL_DestroyWindow(win),SDL_Quit();} V graph_before(V){glClearColor(1.0,0.75,0.8,1.0),glClear(GL_COLOR_BUFFER_BIT);} V graph_after(V){SDL_GL_SwapWindow(win);} +U32 graph_ticks(V){R SDL_GetTicks();} + _ U32 q_vao,q_vbo,q_ebo; _ V q_init(V){ _ IM F32 verts[]={ @@ -84,8 +87,8 @@ U32 graph_shader_create(IM C*vert,IM C*frag){I ok;C info[512];U32 v,f,p; R 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_setI(IM C*s,I i) {I p;glGetIntegerv(GL_CURRENT_PROGRAM,&p),glUniform1i(glGetUniformLocation(p,s),i);} +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]);} U32 graph_tex_create(IM C*f){Tex tex;U32 t; glGenTextures(1,&t); -- cgit v1.2.3