gba-x3dtest

annotate src/mesh.c @ 12:ecc022a21279

more tuff
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 23 Jun 2014 06:44:04 +0300
parents
children 2070a81127f2
rev   line source
nuclear@12 1 #include <stdlib.h>
nuclear@12 2 #include "mesh.h"
nuclear@12 3 #include "x3d.h"
nuclear@12 4
nuclear@12 5 void init_mesh(struct mesh *m)
nuclear@12 6 {
nuclear@12 7 m->prim = X3D_TRIANGLES;
nuclear@12 8 m->verts = 0;
nuclear@12 9 m->nverts = 0;
nuclear@12 10 }
nuclear@12 11
nuclear@12 12 void destroy_mesh(struct mesh *m)
nuclear@12 13 {
nuclear@12 14 free(m->verts);
nuclear@12 15 }
nuclear@12 16
nuclear@12 17 void draw_mesh(struct mesh *m)
nuclear@12 18 {
nuclear@12 19 x3d_vertex_array(m->nverts, m->verts);
nuclear@12 20 x3d_draw(m->prim, m->nverts);
nuclear@12 21 x3d_vertex_array(0, 0);
nuclear@12 22 }