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

The surface format defines the properties of the image where we will draw, such as the color space. More...

#include <SwapchainSurfaceFormat.h>

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

The surface format defines the properties of the image where we will draw, such as the color space.

Constructor & Destructor Documentation

◆ SurfaceFormat() [1/3]

Vulkan::SwapchainOptions::SurfaceFormat::SurfaceFormat ( const PhysicalDevice realGpu,
const WindowSurface windowSurface,
std::function< VkSurfaceFormatKHR(const std::vector< VkSurfaceFormatKHR > &)>  chooseBestFormat = chooseBestFormat 
)

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

The default function to choose the best format among the ones available will choose a format which supports VK_COLOR_SPACE_SRGB_NONLINEAR_KHR color space and VK_FORMAT_B8G8R8A8_SRGB format. If this is not available it will return a random format available.

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

◆ SurfaceFormat() [2/3]

Vulkan::SwapchainOptions::SurfaceFormat::SurfaceFormat ( VkSurfaceFormatKHR  format)
inline

◆ SurfaceFormat() [3/3]

Vulkan::SwapchainOptions::SurfaceFormat::SurfaceFormat ( )
default

Member Function Documentation

◆ isThereAnAvailableSurfaceFormat()

bool Vulkan::SwapchainOptions::SurfaceFormat::isThereAnAvailableSurfaceFormat ( const PhysicalDevice realGpu,
const WindowSurface windowSurface 
)
static

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

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

◆ operator+()

const VkSurfaceFormatKHR & Vulkan::SwapchainOptions::SurfaceFormat::operator+ ( ) const

Returns the underlying VkSurfaceFormat.

Returns
The underlying VkSurfaceFormat.

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