From 0e4d5e8ab93439d25aa7dc6704855155b1cb2c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20Kr=C3=A4mer?= <kkraemer4@uni-koblenz.de> Date: Fri, 14 May 2021 12:07:39 +0200 Subject: [PATCH] [#16][Doku] added documentation for class functions in SwapChain --- include/vkcv/SwapChain.hpp | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/include/vkcv/SwapChain.hpp b/include/vkcv/SwapChain.hpp index 147fc6dc..e56866ff 100644 --- a/include/vkcv/SwapChain.hpp +++ b/include/vkcv/SwapChain.hpp @@ -9,10 +9,19 @@ namespace vkcv { private: vk::SurfaceKHR m_surface; - vk::SwapchainKHR m_swapchain; - vk::SurfaceFormatKHR m_format; - - SwapChain(vk::SurfaceKHR surface, vk::SwapchainKHR swapchain, vk::SurfaceFormatKHR format); + vk::SwapchainKHR m_swapchain; + vk::SurfaceFormatKHR m_format; + + /** + * Constructor of a SwapChain object + * glfw is not initialized in this class because ist must be sure that there exists a context first + * glfw is already initialized by the window class + * @param surface used by the swapchain + * @param context of the application + * @param swapchain to show images in the window + * @param format + */ + SwapChain(vk::SurfaceKHR surface, const vkcv::Context &context, vk::SwapchainKHR swapchain, vk::SurfaceFormatKHR format); public: SwapChain(const SwapChain &other) = default; @@ -25,13 +34,30 @@ namespace vkcv { [[nodiscard]] vk::SwapchainKHR getSwapchain(); + /** + * gets the current surface object + * @return current surface + */ [[nodiscard]] vk::SurfaceKHR getSurface(); - + /** + * gets the current surface format + * @return gets the surface format + */ [[nodiscard]] vk::SurfaceFormatKHR getSurfaceFormat(); + /** + * creates a swap chain object out of the given window and the given context + * @param window a wrapper that represents a glfw window + * @param context of the application + * @return returns an object of swapChain + */ static SwapChain create(const Window &window, const Context &context); + + /** + * Destructor of SwapChain + */ virtual ~SwapChain(); }; -- GitLab