VOX
A little voxel engine
Loading...
Searching...
No Matches
Swapchain.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "vk_define.hpp"
4
5#include <vector>
6
8{
9
10public:
11
13 {
14 VkSurfaceCapabilitiesKHR capabilities;
15 std::vector<VkSurfaceFormatKHR> formats;
16 std::vector<VkPresentModeKHR> present_modes;
17 };
18
20 {
21 VkSurfaceFormatKHR surface_format;
22 VkPresentModeKHR present_mode;
23 VkExtent2D extent;
24
25 VkSwapchainKHR old_swapchain;
26 };
27
28 Swapchain();
30 VkDevice device,
31 VkPhysicalDevice physical_device,
32 VkSurfaceKHR surface,
33 CreateInfo create_info
34 );
35
36 Swapchain(const Swapchain &) = delete;
37 Swapchain & operator=(const Swapchain &) = delete;
38
39 Swapchain(Swapchain && other) noexcept;
40 Swapchain & operator=(Swapchain && other) noexcept;
41
42 ~Swapchain();
43
45 VkPhysicalDevice physical_device,
46 VkSurfaceKHR surface
47 );
48
49 void clear();
50
51 VkSwapchainKHR swapchain;
52 VkExtent2D extent;
53 VkFormat image_format;
54 std::vector<VkImage> images;
55 std::vector<VkImageView> image_views;
56
57private:
58
59 VkDevice m_device;
60
61};
Definition: Swapchain.hpp:8
std::vector< VkImage > images
Definition: Swapchain.hpp:54
Swapchain(const Swapchain &)=delete
void clear()
Definition: Swapchain.cpp:140
Swapchain & operator=(const Swapchain &)=delete
~Swapchain()
Definition: Swapchain.cpp:135
VkExtent2D extent
Definition: Swapchain.hpp:52
VkSwapchainKHR swapchain
Definition: Swapchain.hpp:51
VkFormat image_format
Definition: Swapchain.hpp:53
std::vector< VkImageView > image_views
Definition: Swapchain.hpp:55
Swapchain()
Definition: Swapchain.cpp:3
static SupportDetails querySwapChainSupport(VkPhysicalDevice physical_device, VkSurfaceKHR surface)
Definition: Swapchain.cpp:159
Definition: Swapchain.hpp:20
VkExtent2D extent
Definition: Swapchain.hpp:23
VkSurfaceFormatKHR surface_format
Definition: Swapchain.hpp:21
VkPresentModeKHR present_mode
Definition: Swapchain.hpp:22
VkSwapchainKHR old_swapchain
Definition: Swapchain.hpp:25
Definition: Swapchain.hpp:13
std::vector< VkSurfaceFormatKHR > formats
Definition: Swapchain.hpp:15
VkSurfaceCapabilitiesKHR capabilities
Definition: Swapchain.hpp:14
std::vector< VkPresentModeKHR > present_modes
Definition: Swapchain.hpp:16