SDEngine
Game Engine
Loading...
Searching...
No Matches
sd::VulkanWindow Class Reference

#include <VulkanWindow.hpp>

+ Collaboration diagram for sd::VulkanWindow:

Public Member Functions

 VulkanWindow (Window &window, VulkanContext &vulkan_ctx)
 
 ~VulkanWindow ()
 
void recreate_swapchain (LayerList &layers)
 
const Windowget_window () const
 
FrameSyncget_frame_sync ()
 
SwapchainSyncget_swapchain_sync (uint32_t image_index)
 
vk::UniqueSwapchainKHR & get_swapchain ()
 
vk::SwapchainCreateInfoKHR & get_swapchain_create_info ()
 
const std::vector< vk::Image > & get_swapchain_images () const
 
vk::SurfaceFormatKHR & get_surface_format ()
 
vk::Extent2D & get_swapchain_extent ()
 
const std::vector< vk::UniqueImageView > & get_swapchain_image_views () const
 
const std::vector< vk::UniqueFramebuffer > & get_framebuffers () const
 
vk::RenderPass get_render_pass () const
 
std::expected< uint32_t, vk::Result > get_vulkan_images (vk::UniqueSemaphore &image_acquired)
 
vk::Result present_image (uint32_t image_index)
 
void rebuild_per_image_sync ()
 
vk::CommandPool get_command_pool () const
 
void resize (int witdh, int height)
 
bool is_minimized () const
 
bool is_framebuffer_resized () const
 
void reset_framebuffer_resized ()
 
vk::CommandBuffer get_current_command_buffer () const
 
VulkanContextget_vulkan_context ()
 

Public Attributes

uint32_t current_frame = 0
 
uint32_t current_image_index = 0
 

Private Member Functions

void create_swapchain ()
 
void create_render_pass ()
 
void create_command_pool ()
 
void create_swapchain_dependent_resources ()
 
void create_framebuffers ()
 

Private Attributes

VulkanContextm_vulkan_ctx
 
vk::Device & m_device
 
Windowm_window
 
vk::UniqueSurfaceKHR m_surface
 
vk::UniqueSwapchainKHR m_swapchain
 
vk::SwapchainCreateInfoKHR m_swapchain_create_info
 
std::vector< vk::Image > m_swapchain_images
 
std::vector< vk::UniqueImageView > m_swapchain_image_views
 
vk::Extent2D m_swapchain_extent
 
vk::SurfaceFormatKHR m_surface_format
 
vk::SurfaceCapabilitiesKHR m_surface_capabilities
 
vk::UniqueRenderPass m_render_pass
 
vk::UniqueCommandPool m_command_pool
 
std::vector< vk::UniqueCommandBuffer > m_command_buffers
 
std::vector< vk::UniqueFramebuffer > m_framebuffers
 
std::vector< FrameSyncm_frame_syncs
 
std::vector< SwapchainSyncm_swapchain_syncs
 
bool m_is_minimized {}
 
bool m_is_framebuffer_resized {}
 

Constructor & Destructor Documentation

◆ VulkanWindow()

sd::VulkanWindow::VulkanWindow ( Window window,
VulkanContext vulkan_ctx 
)
explicit

◆ ~VulkanWindow()

sd::VulkanWindow::~VulkanWindow ( )

Member Function Documentation

◆ create_command_pool()

void sd::VulkanWindow::create_command_pool ( )
private

◆ create_framebuffers()

void sd::VulkanWindow::create_framebuffers ( )
private

◆ create_render_pass()

void sd::VulkanWindow::create_render_pass ( )
private

◆ create_swapchain()

void sd::VulkanWindow::create_swapchain ( )
private

◆ create_swapchain_dependent_resources()

void sd::VulkanWindow::create_swapchain_dependent_resources ( )
private

◆ get_command_pool()

vk::CommandPool sd::VulkanWindow::get_command_pool ( ) const

◆ get_current_command_buffer()

vk::CommandBuffer sd::VulkanWindow::get_current_command_buffer ( ) const
inline

◆ get_frame_sync()

FrameSync & sd::VulkanWindow::get_frame_sync ( )

◆ get_framebuffers()

const std::vector< vk::UniqueFramebuffer > & sd::VulkanWindow::get_framebuffers ( ) const

◆ get_render_pass()

vk::RenderPass sd::VulkanWindow::get_render_pass ( ) const

◆ get_surface_format()

vk::SurfaceFormatKHR & sd::VulkanWindow::get_surface_format ( )

◆ get_swapchain()

vk::UniqueSwapchainKHR & sd::VulkanWindow::get_swapchain ( )

◆ get_swapchain_create_info()

vk::SwapchainCreateInfoKHR & sd::VulkanWindow::get_swapchain_create_info ( )

◆ get_swapchain_extent()

vk::Extent2D & sd::VulkanWindow::get_swapchain_extent ( )

◆ get_swapchain_image_views()

const std::vector< vk::UniqueImageView > & sd::VulkanWindow::get_swapchain_image_views ( ) const

◆ get_swapchain_images()

const std::vector< vk::Image > & sd::VulkanWindow::get_swapchain_images ( ) const

◆ get_swapchain_sync()

SwapchainSync & sd::VulkanWindow::get_swapchain_sync ( uint32_t  image_index)

◆ get_vulkan_context()

VulkanContext & sd::VulkanWindow::get_vulkan_context ( )
inline

◆ get_vulkan_images()

std::expected< u32, vk::Result > sd::VulkanWindow::get_vulkan_images ( vk::UniqueSemaphore &  image_acquired)

◆ get_window()

const Window & sd::VulkanWindow::get_window ( ) const

◆ is_framebuffer_resized()

bool sd::VulkanWindow::is_framebuffer_resized ( ) const
inline

◆ is_minimized()

bool sd::VulkanWindow::is_minimized ( ) const
inline

◆ present_image()

vk::Result sd::VulkanWindow::present_image ( uint32_t  image_index)

◆ rebuild_per_image_sync()

void sd::VulkanWindow::rebuild_per_image_sync ( )

◆ recreate_swapchain()

void sd::VulkanWindow::recreate_swapchain ( LayerList layers)

◆ reset_framebuffer_resized()

void sd::VulkanWindow::reset_framebuffer_resized ( )
inline

◆ resize()

void sd::VulkanWindow::resize ( int  witdh,
int  height 
)

Member Data Documentation

◆ current_frame

uint32_t sd::VulkanWindow::current_frame = 0

◆ current_image_index

uint32_t sd::VulkanWindow::current_image_index = 0

◆ m_command_buffers

std::vector<vk::UniqueCommandBuffer> sd::VulkanWindow::m_command_buffers
private

◆ m_command_pool

vk::UniqueCommandPool sd::VulkanWindow::m_command_pool
private

◆ m_device

vk::Device& sd::VulkanWindow::m_device
private

◆ m_frame_syncs

std::vector<FrameSync> sd::VulkanWindow::m_frame_syncs
private

◆ m_framebuffers

std::vector<vk::UniqueFramebuffer> sd::VulkanWindow::m_framebuffers
private

◆ m_is_framebuffer_resized

bool sd::VulkanWindow::m_is_framebuffer_resized {}
private

◆ m_is_minimized

bool sd::VulkanWindow::m_is_minimized {}
private

◆ m_render_pass

vk::UniqueRenderPass sd::VulkanWindow::m_render_pass
private

◆ m_surface

vk::UniqueSurfaceKHR sd::VulkanWindow::m_surface
private

◆ m_surface_capabilities

vk::SurfaceCapabilitiesKHR sd::VulkanWindow::m_surface_capabilities
private

◆ m_surface_format

vk::SurfaceFormatKHR sd::VulkanWindow::m_surface_format
private

◆ m_swapchain

vk::UniqueSwapchainKHR sd::VulkanWindow::m_swapchain
private

◆ m_swapchain_create_info

vk::SwapchainCreateInfoKHR sd::VulkanWindow::m_swapchain_create_info
private

◆ m_swapchain_extent

vk::Extent2D sd::VulkanWindow::m_swapchain_extent
private

◆ m_swapchain_image_views

std::vector<vk::UniqueImageView> sd::VulkanWindow::m_swapchain_image_views
private

◆ m_swapchain_images

std::vector<vk::Image> sd::VulkanWindow::m_swapchain_images
private

◆ m_swapchain_syncs

std::vector<SwapchainSync> sd::VulkanWindow::m_swapchain_syncs
private

◆ m_vulkan_ctx

VulkanContext& sd::VulkanWindow::m_vulkan_ctx
private

◆ m_window

Window& sd::VulkanWindow::m_window
private

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