diff --git a/include/vkcv/Event.hpp b/include/vkcv/Event.hpp index b7cc18867032c17fb50bad16b4c37ec096f06cb5..c4a05d0e126c2a44a67cfb4e1aad7d07ad6efaa5 100644 --- a/include/vkcv/Event.hpp +++ b/include/vkcv/Event.hpp @@ -19,11 +19,21 @@ namespace vkcv { + /** + * @brief Template for a function handle to an event + * + * @tparam T Event parameter type list + */ template<typename... T> struct event_handle { uint32_t id; }; + /** + * @brief Template for an event function + * + * @tparam T Event parameter type list + */ template<typename... T> struct event_function { typedef std::function<void(T...)> type; @@ -33,8 +43,9 @@ namespace vkcv { }; /** - * template for event handling - * @tparam T parameter list + * @brief Template for event handling + * + * @tparam T Event parameter type list */ template<typename... T> struct event { @@ -53,8 +64,9 @@ namespace vkcv { public: /** - * calls all function handles with the given arguments - * @param arguments of the given function + * @brief Calls all function handles with the given arguments. + * + * @param[in,out] arguments Arguments of the given event */ void operator()(T... arguments) { lock(); @@ -67,9 +79,10 @@ namespace vkcv { } /** - * adds a function handle to the event to be called - * @param callback of the function - * @return handle of the function + * @brief Adds a function handle to the event to be called. + * + * @param[in] callback Event callback + * @return Handle of the function */ event_handle<T...> add(typename event_function<T...>::type callback) { event_function<T...> function; @@ -80,8 +93,9 @@ namespace vkcv { } /** - * removes a function handle of the event - * @param handle of the function + * @brief Removes a function handle of the event. + * + * @param handle Handle of the function */ void remove(event_handle<T...> handle) { this->m_functions.erase( @@ -93,7 +107,8 @@ namespace vkcv { } /** - * locks the event so its function handles won't be called + * @brief Locks the event so its function handles won't + * be called until unlocked. */ void lock() { #ifndef __MINGW32__ @@ -106,8 +121,9 @@ namespace vkcv { } /** - * unlocks the event so its function handles can be called after locking - */ + * @brief Unlocks the event so its function handles can + * be called after locking. + */ void unlock() { #ifndef __MINGW32__ #ifdef __NO_SEMAPHORES__ diff --git a/include/vkcv/FeatureManager.hpp b/include/vkcv/FeatureManager.hpp index de71292b05f376d7a490155dac205711a5cbd7e0..d7d7b992c742506b9672dc4d6b28ba19c3793f54 100644 --- a/include/vkcv/FeatureManager.hpp +++ b/include/vkcv/FeatureManager.hpp @@ -47,8 +47,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -57,8 +57,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDevice16BitStorageFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -67,8 +67,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDevice8BitStorageFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -77,8 +77,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceBufferDeviceAddressFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -87,8 +87,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceDescriptorIndexingFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -97,8 +97,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceHostQueryResetFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -107,8 +107,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceImagelessFramebufferFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -117,8 +117,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceMultiviewFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -127,8 +127,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceProtectedMemoryFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -137,8 +137,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceSamplerYcbcrConversionFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -147,8 +147,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceScalarBlockLayoutFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -157,8 +157,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceSeparateDepthStencilLayoutsFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -167,8 +167,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceShaderAtomicInt64Features. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -177,8 +177,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceShaderFloat16Int8Features. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -187,8 +187,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceShaderSubgroupExtendedTypesFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -197,8 +197,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceTimelineSemaphoreFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -207,8 +207,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceUniformBufferStandardLayoutFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -217,8 +217,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceVariablePointersFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -227,8 +227,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceVulkanMemoryModelFeatures. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -237,8 +237,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceMeshShaderFeaturesNV. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -247,8 +247,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceShaderAtomicFloatFeaturesEXT. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -257,8 +257,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceShaderAtomicFloat2FeaturesEXT. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -267,8 +267,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceVulkan12Features. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -277,8 +277,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceVulkan11Features. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -287,8 +287,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceAccelerationStructureFeaturesKHR. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -297,8 +297,8 @@ namespace vkcv { /** * @brief Checks support of the @p vk::PhysicalDeviceRayTracingPipelineFeaturesKHR. * - * @param features The features - * @param required True, if the @p features are required, else false + * @param[in] features The features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the @p features are supported, else @p false */ [[nodiscard]] @@ -307,7 +307,7 @@ namespace vkcv { /** * @brief Searches for a base structure of a given structure type. * - * @param type Structure type + * @param[in] type Structure type * @return Pointer to first matching base structure or nullptr */ [[nodiscard]] @@ -317,7 +317,7 @@ namespace vkcv { /** * @brief Constructor of a feature manager with a given physical device. * - * @param physicalDevice Physical device + * @param[in,out] physicalDevice Physical device */ explicit FeatureManager(vk::PhysicalDevice& physicalDevice); @@ -326,7 +326,7 @@ namespace vkcv { /** * @brief Move-constructor of a feature manager. * - * @param other Other feature manager instance + * @param[in,out] other Other feature manager instance */ FeatureManager(FeatureManager&& other) noexcept; @@ -340,7 +340,7 @@ namespace vkcv { /** * @brief Move-operator of a feature manager. * - * @param other Other feature manager instance + * @param[in,out] other Other feature manager instance * @return Reference to the feature manager itself */ FeatureManager& operator=(FeatureManager&& other) noexcept; @@ -348,7 +348,7 @@ namespace vkcv { /** * @brief Check if a specific extension is supported by the managers physical device. * - * @param extension Extension identifier string + * @param[in] extension Extension identifier string * @return @p True, if the @p extension is supported, else @p false */ [[nodiscard]] @@ -357,8 +357,8 @@ namespace vkcv { /** * @brief Activate a specific extension if supported by the managers physical device. * - * @param extension Extension identifier string - * @param required True, if the @p extension is required, else false + * @param[in] extension Extension identifier string + * @param[in] required True, if the @p extension is required, else false * @return @p True, if the @p extension could be activated, else @p false */ bool useExtension(const std::string& extension, bool required = true); @@ -366,7 +366,7 @@ namespace vkcv { /** * @brief Check if a specific extension is activated by the manager. * - * @param extension Extension identifier string + * @param[in] extension Extension identifier string * @return @p True, if the @p extension is activated, else @p false */ [[nodiscard]] @@ -383,8 +383,8 @@ namespace vkcv { /** * @brief Request specific features for optional or required usage ( only core Vulkan 1.0 ). * - * @param featureFunction Function or lambda to request specific features - * @param required True, if the @p features are required, else false + * @param[in] featureFunction Function or lambda to request specific features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the requested features could be activated, else @p false */ bool useFeatures(const std::function<void(vk::PhysicalDeviceFeatures&)>& featureFunction, bool required = true); @@ -393,8 +393,8 @@ namespace vkcv { * @brief Request specific features for optional or required usage. * * @tparam T Template parameter to use specific base structure types - * @param featureFunction Function or lambda to request specific features - * @param required True, if the @p features are required, else false + * @param[in] featureFunction Function or lambda to request specific features + * @param[in] required True, if the @p features are required, else false * @return @p True, if the requested features could be activated, else @p false * @see checkSupport() */ diff --git a/include/vkcv/Features.hpp b/include/vkcv/Features.hpp index 0fe03ca4f1c168b0296c71f98aa3985bf6cc9a03..16b6e155a62f52287d35c6c8736ed562328c3537 100644 --- a/include/vkcv/Features.hpp +++ b/include/vkcv/Features.hpp @@ -37,21 +37,21 @@ namespace vkcv { /** * @brief Constructor of a features instance with a given list of extension identifier strings. * - * @param list List of extension identifier strings + * @param[in] list List of extension identifier strings */ Features(const std::initializer_list<std::string>& list); /** * @brief Copy-constructor of a features instance. * - * @param other Other features instance + * @param[in] other Other features instance */ Features(const Features& other) = default; /** * @brief Move-constructor of a features instance. * - * @param other Other features instance + * @param[in,out] other Other features instance */ Features(Features&& other) = default; @@ -63,7 +63,7 @@ namespace vkcv { /** * @brief Copy-operator of a features instance. * - * @param other Other features instance + * @param[in] other Other features instance * @return Reference to the features instance itself */ Features& operator=(const Features& other) = default; @@ -71,7 +71,7 @@ namespace vkcv { /** * @brief Move-operator of a features instance. * - * @param other Other features instance + * @param[in,out] other Other features instance * @return Reference to the features instance itself */ Features& operator=(Features&& other) = default; @@ -79,15 +79,15 @@ namespace vkcv { /** * @brief Request a specific extension as required. * - * @param extension Extension identifier string + * @param[in] extension Extension identifier string */ void requireExtension(const std::string& extension); /** * @brief Request a specific extension and some of its features as required ( only core Vulkan 1.0 ). * - * @param extension Extension identifier string - * @param featureFunction + * @param[in] extension Extension identifier string + * @param[in] featureFunction */ void requireExtensionFeature(const std::string& extension, const std::function<void(vk::PhysicalDeviceFeatures&)>& featureFunction); @@ -96,8 +96,8 @@ namespace vkcv { * @brief Request a specific extension and some of its features as required. * * @tparam T Template parameter to use specific base structure types - * @param extension Extension identifier string - * @param featureFunction Function or lambda to request specific features + * @param[in] extension Extension identifier string + * @param[in] featureFunction Function or lambda to request specific features */ template<typename T> void requireExtensionFeature(const std::string& extension, const std::function<void(T&)>& featureFunction) { @@ -113,7 +113,7 @@ namespace vkcv { /** * @brief Request a specific set of features as required ( only core Vulkan 1.0 ). * - * @param featureFunction Function or lambda to request specific features + * @param[in] featureFunction Function or lambda to request specific features */ void requireFeature(const std::function<void(vk::PhysicalDeviceFeatures&)>& featureFunction); @@ -121,7 +121,7 @@ namespace vkcv { * @brief Request a specific set of features as required. * * @tparam T Template parameter to use specific base structure types - * @param featureFunction Function or lambda to request specific features + * @param[in] featureFunction Function or lambda to request specific features */ template<typename T> void requireFeature(const std::function<void(T&)>& featureFunction) { @@ -133,15 +133,15 @@ namespace vkcv { /** * @brief Request a specific extension as optional. * - * @param extension Extension identifier string + * @param[in] extension Extension identifier string */ void tryExtension(const std::string& extension); /** * @brief Request a specific extension and some of its features as optional ( only core Vulkan 1.0 ). * - * @param extension Extension identifier string - * @param featureFunction Function or lambda to request specific features + * @param[in] extension Extension identifier string + * @param[in] featureFunction Function or lambda to request specific features */ void tryExtensionFeature(const std::string& extension, const std::function<void(vk::PhysicalDeviceFeatures&)>& featureFunction); @@ -150,8 +150,8 @@ namespace vkcv { * @brief Request a specific extension and some of its features as optional. * * @tparam T Template parameter to use specific base structure types - * @param extension Extension identifier string - * @param featureFunction Function or lambda to request specific features + * @param[in] extension Extension identifier string + * @param[in] featureFunction Function or lambda to request specific features */ template<typename T> void tryExtensionFeature(const std::string& extension, const std::function<void(T&)>& featureFunction) { @@ -167,7 +167,7 @@ namespace vkcv { /** * @brief Request a specific set of features as optional ( only core Vulkan 1.0 ). * - * @param featureFunction Function or lambda to request specific features + * @param[in] featureFunction Function or lambda to request specific features */ void tryFeature(const std::function<void(vk::PhysicalDeviceFeatures&)>& featureFunction); @@ -175,7 +175,7 @@ namespace vkcv { * @brief Request a specific set of features as optional. * * @tparam T Template parameter to use specific base structure types - * @param featureFunction Function or lambda to request specific features + * @param[in] featureFunction Function or lambda to request specific features */ template<typename T> void tryFeature(const std::function<void(T&)>& featureFunction) {