X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=model.h;h=467ad989bffab99637ea0e1e00db7a4ed7aa7bce;hb=7bf2284094c18d0e7de1c8823264bdfa36bc7f2e;hp=a1bf8ec24b70aa358abbe7f451c0cc20f196e7d3;hpb=a1a05787ada52089f30c533fb26b745554c07512;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/model.h b/model.h index a1bf8ec..467ad98 100644 --- a/model.h +++ b/model.h @@ -7,7 +7,6 @@ typedef struct model model; typedef struct glmesh glmesh; typedef struct submodel submodel; typedef struct model_vert model_vert; -typedef struct scene scene; typedef struct sdf_primative sdf_primative; typedef enum esdf_type esdf_type; @@ -69,6 +68,12 @@ struct glmesh u32 indice_count; }; +#define VERTEX_STANDARD_ATTRIBUTES \ + "layout (location=0) in vec3 a_co;" \ + "layout (location=1) in vec3 a_norm;" \ + "layout (location=2) in vec4 a_colour;" \ + "layout (location=3) in vec2 a_uv;" + static void mesh_upload( glmesh *mesh, model_vert *verts, u32 vert_count, u32 *indices, u32 indice_count ) @@ -188,4 +193,11 @@ static void model_unpack( model *model, glmesh *mesh ) model_indice_base( model ), model->indice_count ); } +static void mesh_free( glmesh *mesh ) +{ + glDeleteVertexArrays( 1, &mesh->vao ); + glDeleteBuffers( 1, &mesh->ebo ); + glDeleteBuffers( 1, &mesh->vbo ); +} + #endif