Files
NazaraEngine/include/Nazara/Vulkan/VkSwapchain.hpp
Lynix e332f2f77e Vulkan/Swapchain: Make Acquire Next Image constant
Former-commit-id: 54d3fde63a01b138b8d391d9e318c618e69c5eed [formerly c44a46a3ca62d65f3279bd44f1647996fd03b38e]
Former-commit-id: 25bf025b3853879b0eee577ad4bb7ffe9a96fd4a
2016-06-17 18:12:19 +02:00

52 lines
1.6 KiB
C++

// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_VULKAN_VKSWAPCHAIN_HPP
#define NAZARA_VULKAN_VKSWAPCHAIN_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Vulkan/VkDeviceObject.hpp>
namespace Nz
{
namespace Vk
{
class Swapchain : public DeviceObject<Swapchain, VkSwapchainKHR, VkSwapchainCreateInfoKHR>
{
friend DeviceObject;
public:
Swapchain() = default;
Swapchain(const Swapchain&) = delete;
Swapchain(Swapchain&&) = default;
~Swapchain() = default;
inline bool AcquireNextImage(Nz::UInt64 timeout, VkSemaphore semaphore, VkFence fence, UInt32* imageIndex) const;
inline bool Create(const DeviceHandle& device, const VkSwapchainCreateInfoKHR& createInfo, const VkAllocationCallbacks* allocator = nullptr);
inline VkImage GetImage(UInt32 index) const;
inline const std::vector<VkImage>& GetImages() const;
inline UInt32 GetImageCount() const;
inline bool IsSupported() const;
Swapchain& operator=(const Swapchain&) = delete;
Swapchain& operator=(Swapchain&&) = delete;
private:
static VkResult CreateHelper(const DeviceHandle& device, const VkSwapchainCreateInfoKHR* createInfo, const VkAllocationCallbacks* allocator, VkSwapchainKHR* handle);
static void DestroyHelper(const DeviceHandle& device, VkSwapchainKHR handle, const VkAllocationCallbacks* allocator);
std::vector<VkImage> m_images;
};
}
}
#include <Nazara/Vulkan/VkSwapchain.inl>
#endif // NAZARA_VULKAN_VKSWAPCHAIN_HPP