gba-x3dtest
view 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 |
line source
1 #include <stdlib.h>
2 #include "mesh.h"
3 #include "x3d.h"
5 void init_mesh(struct mesh *m)
6 {
7 m->prim = X3D_TRIANGLES;
8 m->verts = 0;
9 m->nverts = 0;
10 }
12 void destroy_mesh(struct mesh *m)
13 {
14 free(m->verts);
15 }
17 void draw_mesh(struct mesh *m)
18 {
19 x3d_vertex_array(m->nverts, m->verts);
20 x3d_draw(m->prim, m->nverts);
21 x3d_vertex_array(0, 0);
22 }