+ glBindVertexArray( mesh->vao );
+ glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh->ebo );
+ glBufferData( GL_ELEMENT_ARRAY_BUFFER, indice_count*sizeof(u32),
+ indices, GL_STATIC_DRAW );
+
+ /* 0: coordinates */
+ glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, stride, (void*)0 );
+ glEnableVertexAttribArray( 0 );
+
+ /* 1: normal */
+ glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE,
+ stride, (void *)offsetof(mdl_vert, norm) );
+ glEnableVertexAttribArray( 1 );
+
+ /* 2: uv */
+ glVertexAttribPointer( 2, 2, GL_FLOAT, GL_FALSE,
+ stride, (void *)offsetof(mdl_vert, uv) );
+ glEnableVertexAttribArray( 2 );
+
+ /* 3: colour */
+ glVertexAttribPointer( 3, 4, GL_UNSIGNED_BYTE, GL_TRUE,
+ stride, (void *)offsetof(mdl_vert, colour) );
+ glEnableVertexAttribArray( 3 );
+
+ /* 4: weights */
+ glVertexAttribPointer( 4, 4, GL_UNSIGNED_SHORT, GL_TRUE,
+ stride, (void *)offsetof(mdl_vert, weights) );
+ glEnableVertexAttribArray( 4 );
+
+ /* 5: groups */
+ glVertexAttribIPointer( 5, 4, GL_UNSIGNED_BYTE,
+ stride, (void *)offsetof(mdl_vert, groups) );
+ glEnableVertexAttribArray( 5 );
+
+ VG_CHECK_GL_ERR();
+
+ mesh->indice_count = indice_count;
+ mesh->loaded = 1;