diff options
Diffstat (limited to 'src/util/asset_manager_utils.h')
| -rw-r--r-- | src/util/asset_manager_utils.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/util/asset_manager_utils.h b/src/util/asset_manager_utils.h new file mode 100644 index 0000000..b738692 --- /dev/null +++ b/src/util/asset_manager_utils.h @@ -0,0 +1,32 @@ +// This file is part of the 64k demo project. +// Typed asset helpers for specialized asset retrieval. +// Only include this if you need TextureAsset or MeshAsset structs. + +#pragma once +#include "asset_manager.h" + +struct TextureAsset { + int width; + int height; + const uint8_t* pixels; +}; + +struct MeshVertex { + float p[3]; + float n[3]; + float u[2]; +}; + +struct MeshAsset { + uint32_t num_vertices; + const MeshVertex* vertices; + uint32_t num_indices; + const uint32_t* indices; +}; + +// Helper to retrieve and parse a simple texture asset (from packer's +// [w][h][pixels] format) +TextureAsset GetTextureAsset(AssetId asset_id); + +// Helper to retrieve and parse a mesh asset (from packer's binary format) +MeshAsset GetMeshAsset(AssetId asset_id); |
