Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
VulkanContext.hpp
Go to the documentation of this file.
1#pragma once
2#include <vulkan/vulkan.h>
3#include <GLFW/glfw3.h>
4#include <vector>
5
11public:
13 VkInstance instance = VK_NULL_HANDLE;
15 VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
17 VkDevice device = VK_NULL_HANDLE;
19 VkQueue graphicsQueue = VK_NULL_HANDLE;
21 VkQueue presentQueue = VK_NULL_HANDLE;
23 VkSurfaceKHR surface = VK_NULL_HANDLE;
24
29 void init(GLFWwindow* window);
33 void cleanup();
34
35private:
39 void createInstance();
43 void pickPhysicalDevice();
48};
Manages initialization and destruction of Vulkan Instance, physical/logical devices,...
Definition VulkanContext.hpp:10
void pickPhysicalDevice()
Scans and picks the first suitable physical GPU.
Definition VulkanContext.cpp:31
VkQueue graphicsQueue
Queue for command submissions to graphic pipeline.
Definition VulkanContext.hpp:19
void createInstance()
Creates the main Vulkan instance.
Definition VulkanContext.cpp:9
VkSurfaceKHR surface
Presentation surface coupling GLFW window and Vulkan.
Definition VulkanContext.hpp:23
void createLogicalDevice()
Configures queue families and instantiates the logical device interface.
Definition VulkanContext.cpp:47
void init(GLFWwindow *window)
Sets up Vulkan instance, window surface, picks physical GPU and logical device context.
Definition VulkanContext.cpp:108
VkPhysicalDevice physicalDevice
Selected GPU physical device handle.
Definition VulkanContext.hpp:15
VkDevice device
Vulkan logical device context.
Definition VulkanContext.hpp:17
VkInstance instance
Vulkan root instance handle.
Definition VulkanContext.hpp:13
void cleanup()
Releases Vulkan logical device, surface, and instance handles.
Definition VulkanContext.cpp:123
VkQueue presentQueue
Queue for command submissions to system present pipeline.
Definition VulkanContext.hpp:21