Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::vk::Context Class Reference

Owns the Vulkan instance, surface (tied to a GLFW window), physical + logical device, and graphics/present queues. More...

#include <Context.h>

Public Member Functions

 Context (GLFWwindow *window, bool enableValidation)
 
 ~Context ()
 
 Context (const Context &)=delete
 
Contextoperator= (const Context &)=delete
 
VkInstance GetInstance () const
 
VkSurfaceKHR GetSurface () const
 
VkPhysicalDevice GetPhysicalDevice () const
 
VkDevice GetDevice () const
 
VkQueue GetGraphicsQueue () const
 
VkQueue GetPresentQueue () const
 
QueueFamilies GetQueueFamilies () const
 

Detailed Description

Owns the Vulkan instance, surface (tied to a GLFW window), physical + logical device, and graphics/present queues.

Construction order matches typical Vulkan boot:

  1. CreateInstance (+ optional debug messenger when validation layers requested)
  2. CreateSurface (via glfwCreateWindowSurface)
  3. PickPhysicalDevice (scores by queue family + swapchain support)
  4. CreateLogicalDevice (one queue from each unique family)

Definition at line 40 of file Context.h.

Constructor & Destructor Documentation

◆ Context() [1/2]

mnd::vk::Context::Context ( GLFWwindow *  window,
bool  enableValidation 
)
Parameters
windowRequired — used to create a VkSurfaceKHR via GLFW.
enableValidationToggle VK_LAYER_KHRONOS_validation + debug messenger.

Definition at line 123 of file Context.cpp.

◆ ~Context()

mnd::vk::Context::~Context ( )

Definition at line 136 of file Context.cpp.

◆ Context() [2/2]

mnd::vk::Context::Context ( const Context )
delete

Member Function Documentation

◆ GetDevice()

VkDevice mnd::vk::Context::GetDevice ( ) const
inline

◆ GetGraphicsQueue()

VkQueue mnd::vk::Context::GetGraphicsQueue ( ) const
inline

Definition at line 59 of file Context.h.

Referenced by mnd::vk::Renderer::DrawFrame().

◆ GetInstance()

VkInstance mnd::vk::Context::GetInstance ( ) const
inline

Definition at line 51 of file Context.h.

◆ GetPhysicalDevice()

VkPhysicalDevice mnd::vk::Context::GetPhysicalDevice ( ) const
inline

Definition at line 55 of file Context.h.

◆ GetPresentQueue()

VkQueue mnd::vk::Context::GetPresentQueue ( ) const
inline

Definition at line 61 of file Context.h.

Referenced by mnd::vk::Renderer::DrawFrame().

◆ GetQueueFamilies()

QueueFamilies mnd::vk::Context::GetQueueFamilies ( ) const
inline

Definition at line 63 of file Context.h.

◆ GetSurface()

VkSurfaceKHR mnd::vk::Context::GetSurface ( ) const
inline

Definition at line 53 of file Context.h.

◆ operator=()

Context & mnd::vk::Context::operator= ( const Context )
delete

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