1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-22 12:07:45 +00:00
novus/renderer/include/swapchain.h

32 lines
748 B
C
Raw Normal View History

2024-04-22 15:47:23 -04:00
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <array>
#include <vector>
#include <vulkan/vulkan.h>
class Device;
class SwapChain
{
public:
SwapChain(Device &device, VkSurfaceKHR surface, int width, int height);
void resize(VkSurfaceKHR surface, int width, int height);
VkSwapchainKHR swapchain = VK_NULL_HANDLE;
VkExtent2D extent;
std::vector<VkImage> swapchainImages;
std::vector<VkImageView> swapchainViews;
std::array<VkFence, 3> inFlightFences;
std::array<VkSemaphore, 3> imageAvailableSemaphores, renderFinishedSemaphores;
uint32_t currentFrame = 0;
VkFormat surfaceFormat;
private:
Device &m_device;
2024-04-22 15:47:23 -04:00
};