diff options
Diffstat (limited to 'graph.c')
-rw-r--r-- | graph.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,6 +2,7 @@ #include<glad/glad.h> #define SDL_MAIN_HANDLED #include<SDL.h> +#include<cglm/cglm.h> #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); |