diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 20:57:06 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 20:59:39 +0200 |
| commit | e5af28536bfb0f4c9131df56d2009ba5196f5e3a (patch) | |
| tree | 3ab928f961a1ccd8440b070d7b57f79146457e8c /src/resource.h | |
| download | animtool-e5af28536bfb0f4c9131df56d2009ba5196f5e3a.tar.xz | |
init
Diffstat (limited to 'src/resource.h')
| -rw-r--r-- | src/resource.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/resource.h b/src/resource.h new file mode 100644 index 0000000..1e6a354 --- /dev/null +++ b/src/resource.h @@ -0,0 +1,55 @@ +#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 |
