scenefile

view src/mesh.h @ 1:38489ad82bf4

foo
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sat, 14 Jan 2012 08:10:50 +0200
parents 8c6d64af9505
children b30f83409769
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 struct mesh_vertattr;
5 struct mesh_polyidx;
6 struct mesh;
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
12 /* --- vertex attributes --- */
14 int vattr_init(struct mesh_vertattr *ma, int elem_sz);
15 void vattr_destroy(struct mesh_vertattr *ma);
17 int vattr_set_name(struct mesh_vertattr *ma, const char *name);
18 const char *vattr_get_name(struct mesh_vertattr *ma);
20 int vattr_add_elem(struct mesh_vertattr *ma, void *elem);
22 void *vattr_pointer(struct mesh_vertattr *ma);
23 int vattr_count(struct mesh_vertattr *ma);
24 int vattr_elem_size(struct mesh_vertattr *ma);
26 /* --- mesh --- */
28 int mesh_init(struct mesh *m, int nverts);
29 void mesh_destroy(struct mesh *m);
31 int mesh_set_name(struct mesh *m, const char *name);
32 const char *mesh_get_name(struct mesh *m);
34 int mesh_add_attrib(struct mesh *m, struct mesh_vertattr *attr);
35 int mesh_find_attrib(struct mesh *m, const char *name);
37 int mesh_attr_count(struct mesh *m);
38 int mesh_poly_count(struct mesh *m);
40 /* the variable arguments correspond to the N indices of the N-gon
41 * for this particular vertex attribute (attr_loc, retrieved by
42 * mesh_find_attrib)
43 */
44 int mesh_add_polyref(struct mesh *m, int attr_loc, ...);
46 #ifdef __cplusplus
47 }
48 #endif
50 #endif /* MESH_H_ */