Initial Gitea Commit
This commit is contained in:
53
VulkanInstanceManager.h
Normal file
53
VulkanInstanceManager.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#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();
|
||||
};
|
||||
Reference in New Issue
Block a user