VulkanEngine 0.1
Graphics engine using Vulkan
Loading...
Searching...
No Matches
Swapchain.h
1// Copyright (c) 2024 Michael Carlie. All Rights Reserved.
2//
3// This software is released under the MIT License.
4// https://opensource.org/licenses/MIT
5
6#ifndef INCLUDE_VULKANENGINE_SWAPCHAIN_H_
7#define INCLUDE_VULKANENGINE_SWAPCHAIN_H_
8
9#include <VulkanEngine/RenderPass.h>
10#include <VulkanEngine/VulkanManager.h>
11#include <VulkanEngine/Window.h>
12
13#include <memory>
14#include <vector>
15
16namespace VulkanEngine {
17
19class Swapchain {
20 public:
22 Swapchain(uint32_t number_of_images, std::shared_ptr<Window> _window,
23 std::shared_ptr<RenderPass> render_pass);
24
26 ~Swapchain();
27
28 bool present();
29
30 vk::Framebuffer getFramebuffer(size_t index);
31
32 vk::SwapchainKHR getVkSwapChain();
33
34 void waitForFence();
35
36 private:
37 vk::SwapchainKHR vk_swapchain;
38 std::vector<vk::Image> vk_swapchain_images;
39 std::vector<vk::ImageView> vk_swapchain_image_views;
40 std::vector<vk::Framebuffer> vk_swapchain_framebuffers;
41
42 std::vector<vk::Semaphore> vk_image_available_semaphores;
43 std::vector<vk::Semaphore> vk_rendering_finished_semaphores;
44 std::vector<vk::Fence> vk_in_flight_fences;
45
46 std::shared_ptr<Window> window;
47};
48
49} // namespace VulkanEngine
50
51#endif // INCLUDE_VULKANENGINE_SWAPCHAIN_H_
Class which represents the swapchain.
Definition: Swapchain.h:19
~Swapchain()
Destructor.
Definition: Swapchain.cpp:112
TODO development of this class is in progress.
Definition: Attribute.h:13