Add Asset system

- Add Abstract Asset class which defines Assets
- Add AssetManager class to keep track of all the Asset
- Add AssetFile class to cache the asset without loading it
- Add UUID class to uniquely identify assets
- Add MetaFile class to load meta asset files
This commit is contained in:
Thraix
2023-04-13 21:00:36 +02:00
parent 431ad9c573
commit d9e7fd7019
29 changed files with 1002 additions and 37 deletions
+9 -1
View File
@@ -1,5 +1,7 @@
#include "copium/core/Vulkan.h"
#include "copium/asset/AssetManager.h"
namespace Copium
{
std::unique_ptr<Instance> Vulkan::instance;
@@ -10,13 +12,19 @@ namespace Copium
void Vulkan::Initialize()
{
instance = std::make_unique<Instance>("Copium Engine");
window = std::make_unique<Window>( "Copium Engine", 1920, 1080, Window::Mode::Windowed);
window = std::make_unique<Window>("Copium Engine", 1920, 1080, Window::Mode::Windowed);
device = std::make_unique<Device>();
swapChain = std::make_unique<SwapChain>();
// TODO: Make the working directory always be relative to the assets folder
// By looking at where the executable is, since that should always be in the bin folder (it currently isn't though)
AssetManager::RegisterAssetDir("assets/");
}
void Vulkan::Destroy()
{
AssetManager::UnregisterAssetDir("assets/");
AssetManager::Cleanup();
swapChain.reset();
device.reset();
window.reset();