|
Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
|
Manages initialization and destruction of Vulkan Instance, physical/logical devices, and surface interfaces. More...
#include <VulkanContext.hpp>
Public Member Functions | |
| void | init (GLFWwindow *window) |
| Sets up Vulkan instance, window surface, picks physical GPU and logical device context. | |
| void | cleanup () |
| Releases Vulkan logical device, surface, and instance handles. | |
Public Attributes | |
| VkInstance | instance = VK_NULL_HANDLE |
| Vulkan root instance handle. | |
| VkPhysicalDevice | physicalDevice = VK_NULL_HANDLE |
| Selected GPU physical device handle. | |
| VkDevice | device = VK_NULL_HANDLE |
| Vulkan logical device context. | |
| VkQueue | graphicsQueue = VK_NULL_HANDLE |
| Queue for command submissions to graphic pipeline. | |
| VkQueue | presentQueue = VK_NULL_HANDLE |
| Queue for command submissions to system present pipeline. | |
| VkSurfaceKHR | surface = VK_NULL_HANDLE |
| Presentation surface coupling GLFW window and Vulkan. | |
Private Member Functions | |
| void | createInstance () |
| Creates the main Vulkan instance. | |
| void | pickPhysicalDevice () |
| Scans and picks the first suitable physical GPU. | |
| void | createLogicalDevice () |
| Configures queue families and instantiates the logical device interface. | |
Manages initialization and destruction of Vulkan Instance, physical/logical devices, and surface interfaces.
| void VulkanContext::cleanup | ( | ) |
Releases Vulkan logical device, surface, and instance handles.
Destroys logical devices, surfaces and instance.
|
private |
Creates the main Vulkan instance.
Configures app settings and creates raw Vulkan instance.
|
private |
Configures queue families and instantiates the logical device interface.
Searches queue family layouts and allocates logical device bindings.
| void VulkanContext::init | ( | GLFWwindow * | window | ) |
Sets up Vulkan instance, window surface, picks physical GPU and logical device context.
Triggers the sequence of Vulkan initialization steps.
| window | Pointer to GLFW window. |
| window | target window pointer. |
|
private |
Scans and picks the first suitable physical GPU.
Queries physical GPUs and selects the first active device.
| VkDevice VulkanContext::device = VK_NULL_HANDLE |
Vulkan logical device context.
| VkQueue VulkanContext::graphicsQueue = VK_NULL_HANDLE |
Queue for command submissions to graphic pipeline.
| VkInstance VulkanContext::instance = VK_NULL_HANDLE |
Vulkan root instance handle.
| VkPhysicalDevice VulkanContext::physicalDevice = VK_NULL_HANDLE |
Selected GPU physical device handle.
| VkQueue VulkanContext::presentQueue = VK_NULL_HANDLE |
Queue for command submissions to system present pipeline.
| VkSurfaceKHR VulkanContext::surface = VK_NULL_HANDLE |
Presentation surface coupling GLFW window and Vulkan.