From c6e34bea903390b10e40364b56020804dbb0b6b5 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 10 Aug 2023 21:32:39 -0400 Subject: asset manager first pass --- src/asset-manager.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/asset-manager.hpp (limited to 'src/asset-manager.hpp') diff --git a/src/asset-manager.hpp b/src/asset-manager.hpp new file mode 100644 index 0000000..2354cba --- /dev/null +++ b/src/asset-manager.hpp @@ -0,0 +1,25 @@ +#ifndef PKE_ASSET_MANAGER_HPP +#define PKE_ASSET_MANAGER_HPP + +#include "macros.hpp" +#include "memory.hpp" + +#include +#include +#include + +TypeSafeInt_H(AssetHandle, uint64_t, UINT64_MAX); + +struct Asset{ + char key[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int64_t size = 0; + void *ptr = nullptr; +}; + +void AssetManagerInit(); +AssetHandle RegisterAsset(const void *data, int64_t size, const char *key); +AssetHandle RegisterAsset(char *path); +void DestroyAsset(AssetHandle assetHandle); +const Asset *GetAsset(AssetHandle assetHandle); + +#endif /* PKE_ASSET_MANAGER_HPP */ -- cgit v1.2.3