-
Notifications
You must be signed in to change notification settings - Fork 1
/
Swapchain.h
47 lines (36 loc) · 956 Bytes
/
Swapchain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef VKOCCLUSIONTEST_SWAPCHAIN_H
#define VKOCCLUSIONTEST_SWAPCHAIN_H
#include "Instance.h"
#include <memory>
#include <vector>
#include <glm/glm.hpp>
class Swapchain {
private:
std::shared_ptr<Instance> instance;
vk::SurfaceKHR _surface;
vk::SwapchainKHR _swapchain;
vk::SurfaceFormatKHR _surface_format;
std::vector<vk::ImageView> _image_views;
glm::ivec2 _size;
public:
Swapchain(SDL_Window* window, std::shared_ptr<Instance> instance);
bool create_swapchain(glm::ivec2 size);
bool destroy_swapchain();
~Swapchain();
inline const vk::SurfaceKHR& surface() const {
return _surface;
}
inline const vk::SwapchainKHR& swapchain() const {
return _swapchain;
}
inline const std::vector<vk::ImageView>& image_views() const& {
return _image_views;
}
inline vk::SurfaceFormatKHR surface_format() const {
return _surface_format;
}
inline glm::ivec2 size() const {
return _size;
}
};
#endif //VKOCCLUSIONTEST_SWAPCHAIN_H