X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=model.h;h=9558d1e42b22480284e863982c2c770a0c45ce4b;hb=39378a28bc0b7c9beaf9f2191f5dc51b8c8865a0;hp=9788dc1446c080aaf15f71a00beee5fb1b163c8d;hpb=51a9d6b9321b951b79dff0d52a82116c678ad8aa;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/model.h b/model.h index 9788dc1..9558d1e 100644 --- a/model.h +++ b/model.h @@ -78,12 +78,6 @@ 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 ) @@ -203,6 +197,13 @@ static void submodel_draw( submodel *sm ) mesh_drawn( sm->indice_start, sm->indice_count ); } +static void model_unpack_submodel( model *model, glmesh *mesh, submodel *sm ) +{ + mesh_upload( mesh, + model_vertex_base( model ) + sm->vertex_start, sm->vertex_count, + model_indice_base( model ) + sm->indice_start, sm->indice_count ); +} + static void model_unpack( model *model, glmesh *mesh ) { u32 offset = model_get_submodel( model, 0 )->vertex_count;