summaryrefslogtreecommitdiff
path: root/src/asset-manager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/asset-manager.hpp')
-rw-r--r--src/asset-manager.hpp25
1 files changed, 25 insertions, 0 deletions
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 <cstdint>
+#include <cstring>
+#include <cassert>
+
+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 */