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 Class Reference

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.

Detailed Description

Manages initialization and destruction of Vulkan Instance, physical/logical devices, and surface interfaces.

Member Function Documentation

◆ cleanup()

void VulkanContext::cleanup ( )

Releases Vulkan logical device, surface, and instance handles.

Destroys logical devices, surfaces and instance.

◆ createInstance()

void VulkanContext::createInstance ( )
private

Creates the main Vulkan instance.

Configures app settings and creates raw Vulkan instance.

◆ createLogicalDevice()

void VulkanContext::createLogicalDevice ( )
private

Configures queue families and instantiates the logical device interface.

Searches queue family layouts and allocates logical device bindings.

◆ init()

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.

Parameters
windowPointer to GLFW window.
windowtarget window pointer.

◆ pickPhysicalDevice()

void VulkanContext::pickPhysicalDevice ( )
private

Scans and picks the first suitable physical GPU.

Queries physical GPUs and selects the first active device.

Member Data Documentation

◆ device

VkDevice VulkanContext::device = VK_NULL_HANDLE

Vulkan logical device context.

◆ graphicsQueue

VkQueue VulkanContext::graphicsQueue = VK_NULL_HANDLE

Queue for command submissions to graphic pipeline.

◆ instance

VkInstance VulkanContext::instance = VK_NULL_HANDLE

Vulkan root instance handle.

◆ physicalDevice

VkPhysicalDevice VulkanContext::physicalDevice = VK_NULL_HANDLE

Selected GPU physical device handle.

◆ presentQueue

VkQueue VulkanContext::presentQueue = VK_NULL_HANDLE

Queue for command submissions to system present pipeline.

◆ surface

VkSurfaceKHR VulkanContext::surface = VK_NULL_HANDLE

Presentation surface coupling GLFW window and Vulkan.


The documentation for this class was generated from the following files: