#ifndef ANIMTOOL_RESOURCE_H_ #define ANIMTOOL_RESOURCE_H_ #include "util/container.h" #include "draw.h" #include "source.h" struct texture_source { enum texture_type type; struct loc_str path; }; struct texture { union { texture_id id; struct texture_source source; }; }; enum mesh_source_type { MESH_OBJ, MESH_CUBE, }; struct mesh_source { enum mesh_source_type type; union { struct loc_str path; }; }; struct mesh { union { mesh_id id; struct mesh_source source; }; }; struct cache { option(mesh_id) cube_mesh; map(texture_id) textures[2]; map(mesh_id) meshes; }; void texture_load(struct texture *tex, struct source *src, struct draw_backend *draw, struct cache *cache); void mesh_load(struct mesh *mesh, struct source *src, struct draw_backend *draw, struct cache *cache); void cache_free(struct cache *cache); #endif