summaryrefslogtreecommitdiff
path: root/src/asset-manager.hpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-08-10 21:32:39 -0400
committerJonathan Bradley <jcb@pikum.xyz>2023-08-10 21:32:39 -0400
commitc6e34bea903390b10e40364b56020804dbb0b6b5 (patch)
tree93978e40c9cb718457199c048520f2d658d376ce /src/asset-manager.hpp
parent0a62361737652112a3dbace2c0f3f7fa025c4ca2 (diff)
asset manager first pass
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 */