From 1346c3e2c03fb4ae03da60bf6818b0dc790d4040 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 14 May 2016 15:41:26 +0200 Subject: [PATCH] Vulkan/Swapchain: Fix compilation Former-commit-id: 22679aa8e212c63360903f3094a60441323b488a --- include/Nazara/Vulkan/VkSwapchain.hpp | 6 ++++++ include/Nazara/Vulkan/VkSwapchain.inl | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/Nazara/Vulkan/VkSwapchain.hpp b/include/Nazara/Vulkan/VkSwapchain.hpp index 7feb6518f..dbef41394 100644 --- a/include/Nazara/Vulkan/VkSwapchain.hpp +++ b/include/Nazara/Vulkan/VkSwapchain.hpp @@ -16,6 +16,8 @@ namespace Nz { class Swapchain : public DeviceObject { + friend DeviceObject; + public: inline Swapchain(Device& instance); Swapchain(const Swapchain&) = delete; @@ -26,6 +28,10 @@ namespace Nz Swapchain& operator=(const Swapchain&) = delete; Swapchain& operator=(Swapchain&&) = delete; + + private: + static VkResult CreateHelper(Device& device, const VkSwapchainCreateInfoKHR* createInfo, const VkAllocationCallbacks* allocator, VkSwapchainKHR* handle); + static void DestroyHelper(Device& device, VkSwapchainKHR handle, const VkAllocationCallbacks* allocator); }; } } diff --git a/include/Nazara/Vulkan/VkSwapchain.inl b/include/Nazara/Vulkan/VkSwapchain.inl index 8c05c0284..e05dfefd3 100644 --- a/include/Nazara/Vulkan/VkSwapchain.inl +++ b/include/Nazara/Vulkan/VkSwapchain.inl @@ -21,6 +21,16 @@ namespace Nz if (!m_device.IsExtensionLoaded("VK_KHR_swapchain")) return false; } + + VkResult Swapchain::CreateHelper(Device& device, const VkSwapchainCreateInfoKHR* createInfo, const VkAllocationCallbacks* allocator, VkSwapchainKHR* handle) + { + return device.vkCreateSwapchainKHR(device, createInfo, allocator, handle); + } + + void Swapchain::DestroyHelper(Device& device, VkSwapchainKHR handle, const VkAllocationCallbacks* allocator) + { + return device.vkDestroySwapchainKHR(device, handle, allocator); + } } }