vOOlkan
An object oriented approach to Vulkan
Vulkan::SwapchainOptions::PresentMode Class Reference

The present mode defines how the images of the swapchain are sent to the screen. More...

#include <SwapchainPresentMode.h>

Public Member Functions

 PresentMode (const PhysicalDevice &realGpu, const WindowSurface &windowSurface, std::function< VkPresentModeKHR(const std::vector< VkPresentModeKHR > &)> chooseBestPresentMode=chooseBestPresentMode)
 Creates a PresentMode object containing the best VkPresentModeKHR for this pair of physical GPU and window surface. More...
 
 PresentMode ()=default
 
const VkPresentModeKHR & operator+ () const
 Returns the underlying VkPresentModeKHR. More...
 

Static Public Member Functions

static bool isThereAnAvailablePresentMode (const PhysicalDevice &realGpu, const WindowSurface &windowSurface)
 

Detailed Description

The present mode defines how the images of the swapchain are sent to the screen.

An object of this class will qury which present modes are available based on the GPU and window surface, and will chose the best one.

Constructor & Destructor Documentation

◆ PresentMode() [1/2]

Vulkan::SwapchainOptions::PresentMode::PresentMode ( const PhysicalDevice realGpu,
const WindowSurface windowSurface,
std::function< VkPresentModeKHR(const std::vector< VkPresentModeKHR > &)>  chooseBestPresentMode = chooseBestPresentMode 
)

Creates a PresentMode object containing the best VkPresentModeKHR for this pair of physical GPU and window surface.

The default function to choose the best present mode among the ones available will choose a present mode with VK_PRESENT_MODE_MAILBOX_KHR. If this is not available it will return a random present mode available.

Parameters
realGpuThe Physical GPU.
windowSurfaceThe OS window surface.
chooseBestFormatOptional function to choose the best present mode among the ones available.

◆ PresentMode() [2/2]

Vulkan::SwapchainOptions::PresentMode::PresentMode ( )
default

Member Function Documentation

◆ isThereAnAvailablePresentMode()

bool Vulkan::SwapchainOptions::PresentMode::isThereAnAvailablePresentMode ( const PhysicalDevice realGpu,
const WindowSurface windowSurface 
)
static

Checks whether there is an available present mode for this pair of GPU and window surface.

Parameters
realGpuThe physical GPU.
windowSurfaceThe window surface.
Returns
Whether there is an available present mode for this pair of GPU and window surface.

◆ operator+()

const VkPresentModeKHR & Vulkan::SwapchainOptions::PresentMode::operator+ ( ) const

Returns the underlying VkPresentModeKHR.

Returns
The underlying VkPresentModeKHR.

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