Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
foray::base::VulkanWindowSwapchain Class Reference

Combines Window, Surface and Swapchain into one managing object. More...

#include <foray_vulkanwindowswapchain.hpp>

Public Types

using BeforeWindowCreateFunctionPointer = std::function< void(osi::Window &)>
 Function called before window is created.
 
using BeforeSwapchainBuildFunctionPointer = std::function< void(vkb::SwapchainBuilder &)>
 Function called before the swapchain is created.
 
using OnResizedFunctionPointer = std::function< void(VkExtent2D)>
 Function called when a resize occurs.
 
using MakeSwapchainImageNameFunctionPointer = std::function< std::string(uint32_t)>
 Function called for naming swapchain images.
 

Public Member Functions

 VulkanWindowSwapchain ()=default
 
 VulkanWindowSwapchain (core::Context *context, BeforeWindowCreateFunctionPointer beforeWindowCreateFunc, BeforeSwapchainBuildFunctionPointer beforeSwapchainBuildFunc, OnResizedFunctionPointer onResizedFunc, MakeSwapchainImageNameFunctionPointer makeSwapchainImageNameFunc)
 
void CreateWindow ()
 Create the Window.
 
void CreateSwapchain ()
 Create the Swapchain.
 
bool Exists () const
 
void Destroy ()
 
void HandleEvent (const osi::Event *event)
 Listens for WindowSizeChanged events to preemptively resize the swapchain.
 
void RecreateSwapchain ()
 Call to recreate the swapchain.
 

Protected Member Functions

void ExtractSwapchainImages ()
 
void DestroySwapchain ()
 

Protected Attributes

BeforeWindowCreateFunctionPointer mBeforeWindowCreateFunc = nullptr
 
BeforeSwapchainBuildFunctionPointer mBeforeSwapchainBuildFunc = nullptr
 
OnResizedFunctionPointer mOnResizedFunc = nullptr
 
MakeSwapchainImageNameFunctionPointer mMakeSwapchainImageNameFunc = nullptr
 
bool mNameSwapchainImages = true
 
core::ContextmContext = nullptr
 
osi::Window mWindow
 
VkSurfaceKHR mSurface = nullptr
 
vkb::Swapchain mSwapchain
 
std::vector< core::SwapchainImageInfomSwapchainImages
 

Detailed Description

Combines Window, Surface and Swapchain into one managing object.

Member Typedef Documentation

◆ BeforeSwapchainBuildFunctionPointer

using foray::base::VulkanWindowSwapchain::BeforeSwapchainBuildFunctionPointer = std::function<void(vkb::SwapchainBuilder&)>

Function called before the swapchain is created.

◆ BeforeWindowCreateFunctionPointer

Function called before window is created.

◆ MakeSwapchainImageNameFunctionPointer

Function called for naming swapchain images.

◆ OnResizedFunctionPointer

using foray::base::VulkanWindowSwapchain::OnResizedFunctionPointer = std::function<void(VkExtent2D)>

Function called when a resize occurs.

Constructor & Destructor Documentation

◆ VulkanWindowSwapchain() [1/2]

foray::base::VulkanWindowSwapchain::VulkanWindowSwapchain ( )
default

◆ VulkanWindowSwapchain() [2/2]

foray::base::VulkanWindowSwapchain::VulkanWindowSwapchain ( core::Context context,
BeforeWindowCreateFunctionPointer  beforeWindowCreateFunc,
BeforeSwapchainBuildFunctionPointer  beforeSwapchainBuildFunc,
OnResizedFunctionPointer  onResizedFunc,
MakeSwapchainImageNameFunctionPointer  makeSwapchainImageNameFunc 
)
inline

Member Function Documentation

◆ CreateSwapchain()

void foray::base::VulkanWindowSwapchain::CreateSwapchain ( )

Create the Swapchain.

◆ CreateWindow()

void foray::base::VulkanWindowSwapchain::CreateWindow ( )

Create the Window.

◆ Destroy()

void foray::base::VulkanWindowSwapchain::Destroy ( )

◆ DestroySwapchain()

void foray::base::VulkanWindowSwapchain::DestroySwapchain ( )
protected

◆ Exists()

bool foray::base::VulkanWindowSwapchain::Exists ( ) const
inline

◆ ExtractSwapchainImages()

void foray::base::VulkanWindowSwapchain::ExtractSwapchainImages ( )
protected

◆ HandleEvent()

void foray::base::VulkanWindowSwapchain::HandleEvent ( const osi::Event event)

Listens for WindowSizeChanged events to preemptively resize the swapchain.

◆ RecreateSwapchain()

void foray::base::VulkanWindowSwapchain::RecreateSwapchain ( )

Call to recreate the swapchain.

Member Data Documentation

◆ mBeforeSwapchainBuildFunc

BeforeSwapchainBuildFunctionPointer foray::base::VulkanWindowSwapchain::mBeforeSwapchainBuildFunc = nullptr
protected

◆ mBeforeWindowCreateFunc

BeforeWindowCreateFunctionPointer foray::base::VulkanWindowSwapchain::mBeforeWindowCreateFunc = nullptr
protected

◆ mContext

core::Context* foray::base::VulkanWindowSwapchain::mContext = nullptr
protected

◆ mMakeSwapchainImageNameFunc

MakeSwapchainImageNameFunctionPointer foray::base::VulkanWindowSwapchain::mMakeSwapchainImageNameFunc = nullptr
protected

◆ mNameSwapchainImages

bool foray::base::VulkanWindowSwapchain::mNameSwapchainImages = true
protected

◆ mOnResizedFunc

OnResizedFunctionPointer foray::base::VulkanWindowSwapchain::mOnResizedFunc = nullptr
protected

◆ mSurface

VkSurfaceKHR foray::base::VulkanWindowSwapchain::mSurface = nullptr
protected

◆ mSwapchain

vkb::Swapchain foray::base::VulkanWindowSwapchain::mSwapchain
protected

◆ mSwapchainImages

std::vector<core::SwapchainImageInfo> foray::base::VulkanWindowSwapchain::mSwapchainImages
protected

◆ mWindow

osi::Window foray::base::VulkanWindowSwapchain::mWindow
protected

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