54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
#define GLFW_INCLUDE_VULKAN
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include "VulkanDebugManager.h"
|
|
#include "VulkanDeviceManager.h"
|
|
|
|
const std::vector<const char*> ValidationLayers = {
|
|
"VK_LAYER_KHRONOS_validation"
|
|
};
|
|
|
|
struct FVulkanConfig
|
|
{
|
|
bool bValidationEnabled = true;
|
|
bool bVerboseLogging = false;
|
|
};
|
|
|
|
class VulkanInstanceManager
|
|
{
|
|
public:
|
|
VulkanInstanceManager();
|
|
~VulkanInstanceManager();
|
|
|
|
VulkanInstanceManager(const VulkanInstanceManager&) = delete;
|
|
VulkanInstanceManager& operator=(const VulkanInstanceManager&) = delete;
|
|
|
|
VulkanInstanceManager(VulkanInstanceManager&& Other) noexcept;
|
|
VulkanInstanceManager& operator=(VulkanInstanceManager&& Other) noexcept;
|
|
|
|
void Initialize(const FVulkanConfig& Config);
|
|
void Cleanup();
|
|
|
|
bool IsInitialized() const { return Instance != VK_NULL_HANDLE; }
|
|
|
|
private:
|
|
std::unique_ptr<VulkanDebugManager> VkDebugManager = nullptr;
|
|
std::unique_ptr<VulkanDeviceManager> VkDeviceManager = nullptr;
|
|
|
|
bool bValidationEnabled = false;
|
|
bool bVerboseLogging = false;
|
|
|
|
VkInstance Instance = VK_NULL_HANDLE;
|
|
|
|
std::vector<const char*> GetRequiredExtensions();
|
|
|
|
bool CheckValidationLayerSupport();
|
|
|
|
void CreateInstance();
|
|
};
|