#include "copium/core/Vulkan.h" #include "copium/asset/AssetManager.h" #include "copium/sampler/Texture2D.h" #include "copium/sampler/ColorAttachment.h" #include "copium/sampler/Font.h" #include "copium/pipeline/Pipeline.h" #include "copium/buffer/Framebuffer.h" namespace Copium { std::unique_ptr Vulkan::instance; std::unique_ptr Vulkan::window; std::unique_ptr Vulkan::device; std::unique_ptr Vulkan::swapChain; void Vulkan::Initialize() { instance = std::make_unique("Copium Engine"); window = std::make_unique("Copium Engine", 1440, 810, WindowMode::Windowed); device = std::make_unique(); swapChain = std::make_unique(); AssetManager::RegisterAssetType("Texture2D"); AssetManager::RegisterAssetType("RenderTexture"); AssetManager::RegisterAssetType("Pipeline"); AssetManager::RegisterAssetType("Framebuffer"); AssetManager::RegisterAssetType("Font"); // 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(); instance.reset(); } Instance& Vulkan::GetInstance() { return *instance; } Window& Vulkan::GetWindow() { return *window; } Device& Vulkan::GetDevice() { return *device; } SwapChain& Vulkan::GetSwapChain() { return *swapChain; } bool Vulkan::Valid() { return instance && window && device && swapChain; } }