57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
#pragma once
|
|
// #include <vector>
|
|
// #include <memory>
|
|
//
|
|
#include "Logger.h"
|
|
#include "VulkanInstanceManager.h"
|
|
#include "VulkanDeviceManager.h"
|
|
#include "VulkanDebugManager.h"
|
|
#include "VulkanGraphicsPipeline.h"
|
|
#include "GlfwWindowManager.h"
|
|
|
|
#define GLFW_INCLUDE_VULKAN
|
|
#include <GLFW/glfw3.h>
|
|
|
|
const std::vector<const char*> ValidationLayers = {
|
|
"VK_LAYER_KHRONOS_validation"
|
|
};
|
|
|
|
struct FVulkanConfig
|
|
{
|
|
bool bValidationEnabled = true;
|
|
bool bVerboseLogging = false;
|
|
};
|
|
|
|
class VulkanContext
|
|
{
|
|
public:
|
|
VulkanContext();
|
|
~VulkanContext();
|
|
|
|
void Initialize(FVulkanConfig& Config);
|
|
void Cleanup();
|
|
|
|
private:
|
|
FVulkanConfig Config = {};
|
|
|
|
VkInstance Instance = VK_NULL_HANDLE;
|
|
VkPhysicalDevice PhysicalDevice = VK_NULL_HANDLE;
|
|
VkDevice Device = VK_NULL_HANDLE;
|
|
VkQueue GraphicsQueue = VK_NULL_HANDLE;
|
|
VkSurfaceKHR Surface = VK_NULL_HANDLE;
|
|
VkDebugUtilsMessengerEXT debugMessenger = VK_NULL_HANDLE;
|
|
|
|
public:
|
|
static VulkanDebugManager DebugManager;
|
|
|
|
private:
|
|
VulkanInstanceManager InstanceManager;
|
|
|
|
public:
|
|
VkInstance GetInstance() const { return Instance; }
|
|
VkPhysicalDevice GetPhysicalDevice() const { return PhysicalDevice; }
|
|
VkDevice GetDevice() const { return Device; }
|
|
VkQueue GetGraphicsQueue() const { return GraphicsQueue; }
|
|
VkSurfaceKHR GetSurface() const { return Surface; }
|
|
};
|