Add copy constructors, assignment operators and cast operators to go forth and back between vkcpp and native vulkan structs and handles.

This commit is contained in:
Markus Tavenrath
2016-02-25 16:48:46 +01:00
parent 6ece7605ee
commit 66627474fe
3 changed files with 1801 additions and 70 deletions

View File

@@ -154,12 +154,25 @@ Here are a few code examples:
<pre>
<code>
try {
vk::Instance i = ...;
VkInstance nativeInstance = nullptr; // Fetch the instance from a favorite toolkit
// create a vkcpp handle from a native handle
vk::Instance i(nativeInstance);
// operator=(VkInstance const &) is also supported
i = nativeInstance;
// Get VkInstance from vk::Instance
nativeInstance = i;
// Get an std::vector as result of an enumeration call.
std::vector<vk::PhysicalDevice> physicalDevices = i.enumeratePhysicalDevices();
vk::FormatProperties formatProperties = physicalDevices[0].getFormatProperties(vk::Format::eR8G8B8A8Unorm);
vk::CommandBuffer commandBuffer = ...;
vk::Buffer buffer = ...;
// Accept std::vector as source for updateBuffer
commandBuffer.updateBuffer(buffer, 0, {some values}); // update buffer with std::vector
}
catch (vk::Exception e)