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
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.

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

View File

@ -187,23 +187,24 @@ const std::string flagsHeader(
"\n"
);
std::string const optionalClassHeader = (
" template <typename RefType>\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 <typename RefType>
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"

View File

@ -41,7 +41,7 @@
# include <vector>
#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 <typename RefType>
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; }