better obj loading
[cyberay] / src / mesh.h
1 #ifndef MESH_H_
2 #define MESH_H_
3
4 #include <GL/gl.h>
5 #include <cgmath/cgmath.h>
6 #include "geom.h"
7
8 struct mesh {
9         struct triangle *faces;
10         int num_faces;
11
12         struct aabox aabb;
13
14         struct material mtl;
15         struct mesh *next;
16 };
17
18 struct scenefile {
19         struct mesh *meshlist;
20         int num_meshes;
21 };
22
23 int load_scenefile(struct scenefile *scn, const char *fname);
24 void destroy_scenefile(struct scenefile *scn);
25
26 void destroy_mesh(struct mesh *m);
27 void draw_mesh(struct mesh *m);
28
29 #endif  /* MESH_H_ */