+/* useful things you can do with the model */
+
+VG_STATIC void mdl_transform_m4x3( mdl_transform *transform, m4x3f mtx )
+{
+ q_m3x3( transform->q, mtx );
+ v3_muls( mtx[0], transform->s[0], mtx[0] );
+ v3_muls( mtx[1], transform->s[1], mtx[1] );
+ v3_muls( mtx[2], transform->s[2], mtx[2] );
+ v3_copy( transform->co, mtx[3] );
+}
+
+VG_STATIC const char *mdl_pstr( mdl_context *mdl, u32 pstr )
+{
+ return mdl_arritm( &mdl->strings, pstr );
+}
+
+/*
+ * Simple mesh interface for OpenGL
+ * ----------------------------------------------------------------------------
+ */
+
+typedef struct glmesh glmesh;
+struct glmesh
+{
+ GLuint vao, vbo, ebo;
+ u32 indice_count;
+ u32 loaded;
+};
+
+VG_STATIC void mesh_upload( glmesh *mesh,
+ mdl_vert *verts, u32 vert_count,
+ u32 *indices, u32 indice_count )
+{
+ //assert( mesh->loaded == 0 );
+
+ glGenVertexArrays( 1, &mesh->vao );
+ glGenBuffers( 1, &mesh->vbo );
+ glGenBuffers( 1, &mesh->ebo );
+ glBindVertexArray( mesh->vao );
+
+ size_t stride = sizeof(mdl_vert);
+
+ glBindBuffer( GL_ARRAY_BUFFER, mesh->vbo );
+ glBufferData( GL_ARRAY_BUFFER, vert_count*stride, verts, GL_STATIC_DRAW );
+
+ glBindVertexArray( mesh->vao );
+ glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh->ebo );
+ glBufferData( GL_ELEMENT_ARRAY_BUFFER, indice_count*sizeof(u32),
+ indices, GL_STATIC_DRAW );