diff --git a/include/vkcv/Surface.hpp b/include/vkcv/Surface.hpp index 18f5a8b909ed505a8d59294c12ae9b5ad1b2b9d9..d0b77b0c06fd9f4b50c4900cc8b5a179ebd37c0f 100644 --- a/include/vkcv/Surface.hpp +++ b/include/vkcv/Surface.hpp @@ -48,10 +48,10 @@ namespace vkcv { ~Surface(); /** - * @brief Creates a surface via a window and a current context + * @brief Creates a surface via a window and a current context. * - * @param window Window - * @param context Context + * @param[in] window Window + * @param[in] context Context * @return Created surface */ static Surface create(const Window &window, @@ -65,15 +65,37 @@ namespace vkcv { [[nodiscard]] vk::SurfaceKHR getSurface() const; + /** + * @brief Returns the queue index of the present queue + * for the surface. + * + * @return Present queue index + */ [[nodiscard]] uint32_t getPresentQueueIndex() const; + /** + * @brief Returns the extent of the surfaces resolution. + * + * @return Extent of surface + */ [[nodiscard]] const vk::Extent2D& getExtent() const; + /** + * @brief Returns the image format of the surface to + * present an image. + * + * @return Vulkan image format + */ [[nodiscard]] vk::Format getFormat() const; + /** + * @brief Returns the color space of the surface. + * + * @return Color space + */ [[nodiscard]] vk::ColorSpaceKHR getColorSpace() const; diff --git a/include/vkcv/Swapchain.hpp b/include/vkcv/Swapchain.hpp index 811da063c2fa3e58335769709aa806d86ad4ae97..472385baab4819f6b3bbdd9b52a36a50392a313b 100644 --- a/include/vkcv/Swapchain.hpp +++ b/include/vkcv/Swapchain.hpp @@ -27,33 +27,35 @@ namespace vkcv std::atomic<bool> m_RecreationRequired; /** - * 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 + * @brief Constructor of the swapchain with the current context, + * a surface and a given vulkan swapchain object. * - * @param context Current context - * @param surface used by the swapchain - * @param swapchain to show images in the window + * @param[in,out] context Current context + * @param[in] surface used by the swapchain + * @param[in,out] swapchain to show images in the window */ Swapchain(const Context &context, const Surface &surface, vk::SwapchainKHR swapchain) noexcept; /** - * checks if the update flag is true - * @return if an update is needed + * @brief Checks whether the swapchain needs to be recreated. + * + * @return True, if the swapchain should be updated, + * otherwise false. */ bool shouldUpdateSwapchain() const; /** - * recreates the swapchain - * @param context that holds the device to recreate the swapchain - * @param window that the new swapchain gets bound to + * @brief Updates and recreates the swapchain. + * + * @param[in,out] context that holds the device to recreate the swapchain + * @param[in] window that the new swapchain gets bound to */ void updateSwapchain(const Context &context, const Window &window); /** - * signal that the swapchain needs to be recreated + * @brief Signals the swapchain to be recreated. */ void signalSwapchainRecreation(); @@ -61,6 +63,8 @@ namespace vkcv Swapchain(const Swapchain& other); /** + * @brief Returns the vulkan swapchain object of the swapchain. + * * @return The swapchain linked with the #SwapChain class * @note The reference to our Swapchain variable is needed for the recreation step */ @@ -68,45 +72,58 @@ namespace vkcv const vk::SwapchainKHR& getSwapchain() const; /** - * gets the current surface object - * @return current surface + * @brief Returns the current surface of the swapchain. + * + * @return Current surface */ [[nodiscard]] const Surface& getSurface() const; /** - * gets the chosen swapchain format - * @return gets the chosen swapchain format + * @brief Returns the image format for the current surface + * of the swapchain. + * + * @return Swapchain image format */ [[nodiscard]] vk::Format getFormat() const; /** - * 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 + * @brief Creates a swapchain for a specific window and + * a given context. + * + * @param[in,out] window Window + * @param[in,out] context Context + * @return New created swapchain */ static Swapchain create(const Window &window, const Context &context); /** - * Destructor of SwapChain + * Destructor of thw swapchain. */ virtual ~Swapchain(); /** - * @return number of images in swapchain + * @brief Returns the amount of images for the swapchain. + * + * @return Number of images */ uint32_t getImageCount() const; /** - * @return the 2d extent of the swapchain + * @brief Returns the extent from the current surface of + * the swapchain. + * + * @return Extent of the swapchains surface */ [[nodiscard]] const vk::Extent2D& getExtent() const; /** - * @return the familyQueueIndex for the surface + * @brief Returns the present queue index to be used with + * the swapchain and its current surface. + * + * @return Present queue family index */ [[nodiscard]] uint32_t getPresentQueueIndex() const;