vOOlkan
An object oriented approach to Vulkan
SwapchainSurfaceFormat.h
Go to the documentation of this file.
1#ifndef VULKAN_SWAPCHAINSURFACEFORMAT
2#define VULKAN_SWAPCHAINSURFACEFORMAT
3
4#include <vulkan/vulkan.h>
5#include <vector>
6#include <functional>
7
8
9namespace Vulkan { class PhysicalDevice; class WindowSurface; namespace SwapchainOptions { class SurfaceFormat; } }
10
15 public:
16
25 SurfaceFormat(const PhysicalDevice& realGpu, const WindowSurface& windowSurface, std::function<VkSurfaceFormatKHR(const std::vector<VkSurfaceFormatKHR>&)> chooseBestFormat = chooseBestFormat);
26
27
28
29 SurfaceFormat(VkSurfaceFormatKHR format) : format{ format } {}
30
31
32
33 SurfaceFormat() = default;
34
40 const VkSurfaceFormatKHR& operator+() const;
41
42
50 static bool isThereAnAvailableSurfaceFormat(const PhysicalDevice& realGpu, const WindowSurface& windowSurface);
51
52 private:
53
54 //Returns the best format among the ones available
55 static VkSurfaceFormatKHR chooseBestFormat(const std::vector<VkSurfaceFormatKHR>& formats);
56
57 VkSurfaceFormatKHR format;
58};
59
60#endif
Represents the GPU (or any other device) that will be used with Vulkan to perform computer graphics.
Definition: PhysicalDevice.h:17
The surface format defines the properties of the image where we will draw, such as the color space.
Definition: SwapchainSurfaceFormat.h:14
const VkSurfaceFormatKHR & operator+() const
Returns the underlying VkSurfaceFormat.
Definition: SwapchainSurfaceFormat.cpp:26
SurfaceFormat(VkSurfaceFormatKHR format)
Definition: SwapchainSurfaceFormat.h:29
static bool isThereAnAvailableSurfaceFormat(const PhysicalDevice &realGpu, const WindowSurface &windowSurface)
Definition: SwapchainSurfaceFormat.cpp:32
A window surface is the connection between Vulkan and the OS windows environment.
Definition: WindowSurface.h:13
Types of queue families.
Definition: Animations.h:17