diff --git a/include/vkcv/Swapchain.hpp b/include/vkcv/Swapchain.hpp index 5e9bc7d0593a3b2e1f1f8e7b5ef7ea69e9711fb5..cffb268a9a529be00b311b1b367b434a7888a607 100644 --- a/include/vkcv/Swapchain.hpp +++ b/include/vkcv/Swapchain.hpp @@ -13,6 +13,8 @@ namespace vkcv class Swapchain final { private: friend class Core; + friend class Window; + friend class SwapchainManager; struct Surface { diff --git a/include/vkcv/Window.hpp b/include/vkcv/Window.hpp index 82f213318d7b99649bf49318bcb083b9497478f9..65627ecd36f7cfad166ce65461c886e06ad749c9 100644 --- a/include/vkcv/Window.hpp +++ b/include/vkcv/Window.hpp @@ -5,6 +5,7 @@ #include <string> #include "Event.hpp" +#include "Handles.hpp" struct GLFWwindow; @@ -12,10 +13,12 @@ namespace vkcv { class Window { friend class WindowManager; + friend class SwapchainManager; private: std::string m_title; bool m_resizable; GLFWwindow *m_window; + SwapchainHandle m_swapchainHandle; public: /** @@ -130,6 +133,12 @@ namespace vkcv { * @param height */ void getFramebufferSize(int& width, int& height) const; + + /** + * gets the SwapchainHandle corresponding to the swapchain of the window + * @return + */ + SwapchainHandle getSwapchainHandle() const; }; } diff --git a/src/vkcv/Window.cpp b/src/vkcv/Window.cpp index d51bb65a0d5d5445e05bc055ca205f32ed2b136b..655ebe1cdd1d767e802f8c6312e64a55f85713d7 100644 --- a/src/vkcv/Window.cpp +++ b/src/vkcv/Window.cpp @@ -305,4 +305,8 @@ namespace vkcv { Window& window = *static_cast<Window *>(glfwGetWindowUserPointer(*activeWindowIterator)); return window; } + + SwapchainHandle Window::getSwapchainHandle() const { + return m_swapchainHandle; + } }