diff --git a/README.md b/README.md index a94f095..03ebfed 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Vulkan-Hpp requires a C++11 capable compiler to compile. The following compilers # namespace vk To avoid name collisions with the Vulkan C API the C++ bindings reside in the vk namespace. The following rules apply to the new naming -* All functions, enums and structs have the Vk prefix removed. - * ```vkCreateImage``` can be accessed as ```vk::CreateImage``` +* All functions, enums, handles, and structs have the Vk prefix removed. In addition to this the first leter of functions is lower case. + * ```vkCreateImage``` can be accessed as ```vk::createImage``` * ```VkImageTiling``` can be accessed as ```vk::ImageTiling``` * ```VkImageCreateInfo``` can be accessed as ```vk::ImageCreateInfo``` * Enums are mapped to scoped enums to provide compile time type safety. The names have been changed to 'e' + CamelCase with the VK_ prefix and type infix removed. In case the enum type is an extension the extension suffix has been removed from the enum values. diff --git a/Vulkan-Docs b/Vulkan-Docs index b972597..08310a8 160000 --- a/Vulkan-Docs +++ b/Vulkan-Docs @@ -1 +1 @@ -Subproject commit b97259786d817bfda38a3b0374782949011e51db +Subproject commit 08310a88df8c803ac916102e7a364fff912e3281 diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 42ad8ef..ed60728 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -187,23 +187,24 @@ const std::string flagsHeader( "\n" ); -std::string const optionalClassHeader = ( - " template \n" - " class Optional\n" - " {\n" - " public:\n" - " Optional(RefType & reference) { m_ptr = &reference; }\n" - " Optional(std::nullptr_t) { m_ptr = nullptr; }\n" - "\n" - " operator RefType*() const { return m_ptr; }\n" - " RefType const* operator->() const { return m_ptr; }\n" - " explicit operator bool() const { return !!m_ptr; }\n" - "\n" - " private:\n" - " RefType *m_ptr;\n" - " };\n" - "\n" -); +std::string const optionalClassHeader = R"( + template + class Optional + { + public: + Optional(RefType & reference) { m_ptr = &reference; } + Optional(RefType * ptr) { m_ptr = ptr; } + Optional(std::nullptr_t) { m_ptr = nullptr; } + + operator RefType*() const { return m_ptr; } + RefType const* operator->() const { return m_ptr; } + explicit operator bool() const { return !!m_ptr; } + + private: + RefType *m_ptr; + }; + +)"; std::string const arrayProxyHeader = ( "#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE\n" diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index dcb0b61..df00d28 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -41,7 +41,7 @@ # include #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -static_assert( VK_HEADER_VERSION == 32 , "Wrong VK_HEADER_VERSION!" ); +static_assert( VK_HEADER_VERSION == 34 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default. // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION @@ -208,11 +208,13 @@ namespace vk return flags ^ bit; } + template class Optional { public: Optional(RefType & reference) { m_ptr = &reference; } + Optional(RefType * ptr) { m_ptr = ptr; } Optional(std::nullptr_t) { m_ptr = nullptr; } operator RefType*() const { return m_ptr; }