Merge remote-tracking branch 'master/master'

This commit is contained in:
Andreas Süßenbach 2016-11-30 15:47:53 +01:00
commit e111c4c010
4 changed files with 24 additions and 21 deletions

View File

@ -13,8 +13,8 @@ Vulkan-Hpp requires a C++11 capable compiler to compile. The following compilers
# namespace vk # 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 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. * 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``` * ```vkCreateImage``` can be accessed as ```vk::createImage```
* ```VkImageTiling``` can be accessed as ```vk::ImageTiling``` * ```VkImageTiling``` can be accessed as ```vk::ImageTiling```
* ```VkImageCreateInfo``` can be accessed as ```vk::ImageCreateInfo``` * ```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. * 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.

@ -1 +1 @@
Subproject commit b97259786d817bfda38a3b0374782949011e51db Subproject commit 08310a88df8c803ac916102e7a364fff912e3281

View File

@ -187,23 +187,24 @@ const std::string flagsHeader(
"\n" "\n"
); );
std::string const optionalClassHeader = ( std::string const optionalClassHeader = R"(
" template <typename RefType>\n" template <typename RefType>
" class Optional\n" class Optional
" {\n" {
" public:\n" public:
" Optional(RefType & reference) { m_ptr = &reference; }\n" Optional(RefType & reference) { m_ptr = &reference; }
" Optional(std::nullptr_t) { m_ptr = nullptr; }\n" Optional(RefType * ptr) { m_ptr = ptr; }
"\n" Optional(std::nullptr_t) { m_ptr = nullptr; }
" operator RefType*() const { return m_ptr; }\n"
" RefType const* operator->() const { return m_ptr; }\n" operator RefType*() const { return m_ptr; }
" explicit operator bool() const { return !!m_ptr; }\n" RefType const* operator->() const { return m_ptr; }
"\n" explicit operator bool() const { return !!m_ptr; }
" private:\n"
" RefType *m_ptr;\n" private:
" };\n" RefType *m_ptr;
"\n" };
);
)";
std::string const arrayProxyHeader = ( std::string const arrayProxyHeader = (
"#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE\n" "#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE\n"

View File

@ -41,7 +41,7 @@
# include <vector> # include <vector>
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #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. // 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 // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION
@ -208,11 +208,13 @@ namespace vk
return flags ^ bit; return flags ^ bit;
} }
template <typename RefType> template <typename RefType>
class Optional class Optional
{ {
public: public:
Optional(RefType & reference) { m_ptr = &reference; } Optional(RefType & reference) { m_ptr = &reference; }
Optional(RefType * ptr) { m_ptr = ptr; }
Optional(std::nullptr_t) { m_ptr = nullptr; } Optional(std::nullptr_t) { m_ptr = nullptr; }
operator RefType*() const { return m_ptr; } operator RefType*() const { return m_ptr; }