#ifndef shader_h #define shader_h u32 compile_shader(u32 type, const char *src); u32 create_shader(const char *vert_src, const char *frag_src); u32 load_shader(u32 type, struct string filename); u32 load_vfshader(struct string vert_filename, struct string frag_filename); void uniform_v3(u32 id, const char *name, v3 v) { i32 loc = gl_get_uniform_location(id, name); gl_uniform_3fv(loc, 1, (f32 *)&v); } void uniform_v4(u32 id, const char *name, v4 v) { i32 loc = gl_get_uniform_location(id, name); gl_uniform_4fv(loc, 1, (f32 *)&v); } void uniform_mat(u32 id, const char *name, mat4 mat) { i32 loc = gl_get_uniform_location(id, name); gl_uniform_matrix_4fv(loc, 1, 0, (f32 *)&mat); } #endif