4 #include "cgmath/cgmath.h"
36 unsigned int tex[NUM_TEX_SLOTS];
38 struct material *next;
46 int num_verts, num_idx;
47 int max_verts, max_idx;
54 unsigned int vbo, ibo;
61 /* doesn't own the meshes */
63 int num_meshes, max_meshes;
68 int num_verts, num_idx;
69 unsigned int vbo, ibo;
73 void init_mesh(struct mesh *m);
74 void destroy_mesh(struct mesh *m);
75 void clear_mesh(struct mesh *m);
76 int copy_mesh(struct mesh *dest, struct mesh *src);
78 void init_meshgroup(struct meshgroup *mg);
79 void destroy_meshgroup(struct meshgroup *mg);
80 void clear_meshgroup(struct meshgroup *mg);
82 void calc_mesh_bounds(struct mesh *m);
84 int add_mesh_vertex(struct mesh *m, struct vertex *v);
85 int add_mesh_index(struct mesh *m, int idx);
86 int add_mesh_face(struct mesh *m, int va, int vb, int vc);
88 int add_meshgroup_mesh(struct meshgroup *mg, struct mesh *m);
90 void draw_mesh(struct mesh *m);
91 void draw_meshgroup(struct meshgroup *mg);
93 void xform_mesh(struct mesh *mesh, float *mat);