scenefile

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/mesh.h	Fri Jan 13 09:34:16 2012 +0200
     1.3 @@ -0,0 +1,44 @@
     1.4 +#ifndef MESH_H_
     1.5 +#define MESH_H_
     1.6 +
     1.7 +struct mesh_attrib {
     1.8 +	char *name;
     1.9 +	int count, elem_size;
    1.10 +	void *data;
    1.11 +
    1.12 +	int datasz;
    1.13 +};
    1.14 +
    1.15 +struct mesh {
    1.16 +	char *name;
    1.17 +	int poly_nverts;	/* 3, 4, etc */
    1.18 +
    1.19 +	struct mesh_attrib *attr;
    1.20 +	int num_attr;
    1.21 +
    1.22 +	int **polyidx;
    1.23 +	int num_poly;
    1.24 +};
    1.25 +
    1.26 +#ifdef __cplusplus
    1.27 +extern "C" {
    1.28 +#endif
    1.29 +
    1.30 +int mattr_init(struct mesh_attrib *ma);
    1.31 +void mattr_destroy(struct mesh_attrib *ma);
    1.32 +
    1.33 +int mattr_set_name(struct mesh_attrib *ma, const char *name);
    1.34 +int mattr_add_elem(struct mesh_attrib *ma, void *data);
    1.35 +
    1.36 +int mesh_init(struct mesh *m);
    1.37 +void mesh_destroy(struct mesh *m);
    1.38 +
    1.39 +int mesh_set_name(struct mesh *m, const char *name);
    1.40 +int mesh_add_attrib(struct mesh *m, struct mesh_attrib *attr);
    1.41 +int mesh_find_attrib(struct mesh *m, const char *name);
    1.42 +
    1.43 +#ifdef __cplusplus
    1.44 +}
    1.45 +#endif
    1.46 +
    1.47 +#endif	/* MESH_H_ */