diff --git a/src/vkcv/Context.cpp b/src/vkcv/Context.cpp index 1ce852fb585865ec80e2831e83d04d52218a5eff..ce5a11e219c69d3c9ee68e8969fbcddffb17c3d8 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 3f658691f965caa63e6f6b6399b8a0af4f4d5778..1d11f82743ada5d1493df48ece54e558c234df47 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 cf8f11d61fde5f6adbe932b07fb22580bc84b017..471075e3b48eb6aba8251d2924c00462f506fbc3 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 6aebcf6470e6fcaf4c0aec03d14a6ccd84e538bb..a4104ae4a8dca0b01825f023bcb3ec2a2808c876 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 da88e8615d7867922511d9ca3009a3adec97d80a..7d8b86e08f25fe7741db1cfa777f00054aa8cee0 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 1681893be18162c882f25904251c23bf0b3254de..d7d51ae6327d9221949e12747b6d7358e7298d1b 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>