From 25815054e1e16d292e04ed2b8840212df75d5b28 Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Tue, 4 May 2021 13:38:00 +0200
Subject: [PATCH] [#20] Added Doxygen comments to context and general file
 descriptions

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 src/vkcv/Context.cpp     |  6 ++++
 src/vkcv/Context.hpp     | 72 +++++++++++++++++++++++++++++++++++++++-
 src/vkcv/CoreManager.cpp |  5 +++
 src/vkcv/CoreManager.hpp |  5 +++
 src/vkcv/Window.cpp      |  6 ++++
 src/vkcv/Window.hpp      |  5 +++
 6 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/src/vkcv/Context.cpp b/src/vkcv/Context.cpp
index 1ce852fb..ce5a11e2 100644
--- a/src/vkcv/Context.cpp
+++ b/src/vkcv/Context.cpp
@@ -1,3 +1,9 @@
+/**
+ * @authors Tobias Frisch, Vanessa Karolek, Katharina Krämer, Sebastian Gaida
+ * @file src/vkcv/Context.cpp
+ * @brief Context class to handle instance, physical-device and device
+ */
+
 #include "Context.hpp"
 #include "CoreManager.hpp"
 
diff --git a/src/vkcv/Context.hpp b/src/vkcv/Context.hpp
index 3f658691..1d11f827 100644
--- a/src/vkcv/Context.hpp
+++ b/src/vkcv/Context.hpp
@@ -1,4 +1,10 @@
 #pragma once
+/**
+ * @authors Tobias Frisch, Vanessa Karolek, Katharina Krämer, Sebastian Gaida
+ * @file src/vkcv/Context.hpp
+ * @brief Context class to handle instance, physical-device and device
+ */
+
 #include <vulkan/vulkan.hpp>
 
 namespace vkcv {
@@ -9,27 +15,91 @@ namespace vkcv {
 		vk::PhysicalDevice m_physicalDevice;
 		vk::Device m_device;
 
+		/**
+		 * Constructor of #Context requires an @p instance, a @p physicalDevice and a @p device.
+		 *
+		 * @param instance Vulkan-Instance
+		 * @param physicalDevice Vulkan-PhysicalDevice
+		 * @param device Vulkan-Device
+		 */
 		Context(vk::Instance instance, vk::PhysicalDevice physicalDevice, vk::Device device);
 
-
 	public:
+		/**
+		 * Copy-constructor of #Context is deleted!
+		 *
+		 * @param other Other instance of #Context
+		 */
 		Context(const Context &other) = delete;
+		
+		/**
+		 * Move-constructor of #Context uses default behavior!
+		 *
+		 * @param other Other instance of #Context
+		 */
 		Context(Context &&other) = default;
 
+		/**
+		 * Get the Vulkan handle for the instance.
+		 *
+		 * @return Vulkan-Instance
+		 */
 		[[nodiscard]]
 		const vk::Instance& getInstance() const;
 		
+		/**
+		 * Get the Vulkan handle for the physical-device.
+		 *
+		 * @return Vulkan-PhysicalDevice
+		 */
 		[[nodiscard]]
 		const vk::PhysicalDevice& getPhysicalDevice() const;
 		
+		/**
+		 * Get the Vulkan handle for the device.
+		 *
+		 * @return Vulkan-Device
+		 */
 		[[nodiscard]]
 		const vk::Device& getDevice() const;
 
+		/**
+		 * Destructor of #Context
+		 */
 		virtual ~Context();
 
+		/**
+		 * Copy-operator of #Context is deleted!
+		 *
+		 * @param other Other instance of #Context
+		 * @return Reference to itself
+		 */
 		Context& operator=(const Context &other) = delete;
+		
+		/**
+		 * Move-operator of #Context uses default behavior!
+		 *
+		 * @param other Other instance of #Context
+		 * @return Reference to itself
+		 */
 		Context& operator=(Context &&other) = default;
 
+		/**
+		 * Creates a #Context with given @p applicationName and @p applicationVersion for your application.
+		 *
+		 * It is also possible to require a specific amount of queues, ask for specific queue-flags or
+		 * extensions. This function will take care of the required arguments as best as possible.
+		 *
+		 * To pass a valid version for your application, you should use #VK_MAKE_VERSION().
+		 *
+		 * @param[in] applicationName Name of the application
+		 * @param[in] applicationVersion Version of the application
+		 * @param[in] queueCount (optional) Amount of queues which is requested
+		 * @param[in] queueFlags (optional) Requested flags of queues
+		 * @param[in] instanceExtensions (optional) Requested instance extensions
+		 * @param[in] deviceExtensions (optional) Requested device extensions
+		 * @return New instance of #Context
+		 */
 		static Context create(const char* applicationName, uint32_t applicationVersion, uint32_t queueCount = 1, std::vector<vk::QueueFlagBits> queueFlags = {}, std::vector<const char*> instanceExtensions = {}, std::vector<const char*> deviceExtensions = {});
 
 		/**
diff --git a/src/vkcv/CoreManager.cpp b/src/vkcv/CoreManager.cpp
index cf8f11d6..471075e3 100644
--- a/src/vkcv/CoreManager.cpp
+++ b/src/vkcv/CoreManager.cpp
@@ -1,3 +1,8 @@
+/**
+ * @authors Sebastian Gaida
+ * @file src/vkcv/CoreManager.cpp
+ * @brief Handling of global states regarding dependencies
+ */
 
 #include "CoreManager.hpp"
 
diff --git a/src/vkcv/CoreManager.hpp b/src/vkcv/CoreManager.hpp
index 6aebcf64..a4104ae4 100644
--- a/src/vkcv/CoreManager.hpp
+++ b/src/vkcv/CoreManager.hpp
@@ -1,4 +1,9 @@
 #pragma once
+/**
+ * @authors Sebastian Gaida
+ * @file src/vkcv/CoreManager.hpp
+ * @brief Handling of global states regarding dependencies
+ */
 
 #include <GLFW/glfw3.h>
 #include <stdexcept>
diff --git a/src/vkcv/Window.cpp b/src/vkcv/Window.cpp
index da88e861..7d8b86e0 100644
--- a/src/vkcv/Window.cpp
+++ b/src/vkcv/Window.cpp
@@ -1,3 +1,9 @@
+/**
+ * @authors Sebastian Gaida
+ * @file src/vkcv/Window.cpp
+ * @brief Window class to handle a basic rendering surface and input
+ */
+
 #include "Window.hpp"
 #include "CoreManager.hpp"
 
diff --git a/src/vkcv/Window.hpp b/src/vkcv/Window.hpp
index 1681893b..d7d51ae6 100644
--- a/src/vkcv/Window.hpp
+++ b/src/vkcv/Window.hpp
@@ -1,4 +1,9 @@
 #pragma once
+/**
+ * @authors Sebastian Gaida
+ * @file src/vkcv/Window.hpp
+ * @brief Window class to handle a basic rendering surface and input
+ */
 
 #define GLFW_INCLUDE_VULKAN
 #include <GLFW/glfw3.h>
-- 
GitLab