scenefile

view src/mesh.h @ 0:8c6d64af9505

scenefile
author John Tsiombikas <nuclear@mutantstargoat.com>
date Fri, 13 Jan 2012 09:34:16 +0200
parents
children 38489ad82bf4
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 struct mesh_attrib {
5 char *name;
6 int count, elem_size;
7 void *data;
9 int datasz;
10 };
12 struct mesh {
13 char *name;
14 int poly_nverts; /* 3, 4, etc */
16 struct mesh_attrib *attr;
17 int num_attr;
19 int **polyidx;
20 int num_poly;
21 };
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 int mattr_init(struct mesh_attrib *ma);
28 void mattr_destroy(struct mesh_attrib *ma);
30 int mattr_set_name(struct mesh_attrib *ma, const char *name);
31 int mattr_add_elem(struct mesh_attrib *ma, void *data);
33 int mesh_init(struct mesh *m);
34 void mesh_destroy(struct mesh *m);
36 int mesh_set_name(struct mesh *m, const char *name);
37 int mesh_add_attrib(struct mesh *m, struct mesh_attrib *attr);
38 int mesh_find_attrib(struct mesh *m, const char *name);
40 #ifdef __cplusplus
41 }
42 #endif
44 #endif /* MESH_H_ */