mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
[samples] Add missing explicit casts
This commit is contained in:
parent
2f4ca1d168
commit
62667a6b4b
@ -44,9 +44,9 @@ int main(int /*argc*/, char ** /*argv*/)
|
|||||||
vk::UniqueSurfaceKHR surface;
|
vk::UniqueSurfaceKHR surface;
|
||||||
{
|
{
|
||||||
VkSurfaceKHR _surface;
|
VkSurfaceKHR _surface;
|
||||||
glfwCreateWindowSurface(instance.get(), window.handle, nullptr, &_surface);
|
glfwCreateWindowSurface(VkInstance(instance.get()), window.handle, nullptr, &_surface);
|
||||||
vk::ObjectDestroy<vk::Instance, VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> _deleter(instance.get());
|
vk::ObjectDestroy<vk::Instance, VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> _deleter(instance.get());
|
||||||
surface = vk::UniqueSurfaceKHR(_surface, _deleter);
|
surface = vk::UniqueSurfaceKHR(vk::SurfaceKHR(_surface), _deleter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine a queueFamilyIndex that suports present
|
// determine a queueFamilyIndex that suports present
|
||||||
|
@ -656,7 +656,7 @@ int main(int /*argc*/, char** /*argv*/)
|
|||||||
|
|
||||||
// Create Window Surface (using glfw)
|
// Create Window Surface (using glfw)
|
||||||
vk::SurfaceKHR surface;
|
vk::SurfaceKHR surface;
|
||||||
VkResult err = glfwCreateWindowSurface(*instance, window, nullptr, reinterpret_cast<VkSurfaceKHR*>(&surface));
|
VkResult err = glfwCreateWindowSurface(VkInstance(*instance), window, nullptr, reinterpret_cast<VkSurfaceKHR*>(&surface));
|
||||||
check_vk_result(err);
|
check_vk_result(err);
|
||||||
|
|
||||||
std::pair<uint32_t, uint32_t> graphicsAndPresentQueueFamilyIndex = vk::su::findGraphicsAndPresentQueueFamilyIndex(physicalDevice, surface);
|
std::pair<uint32_t, uint32_t> graphicsAndPresentQueueFamilyIndex = vk::su::findGraphicsAndPresentQueueFamilyIndex(physicalDevice, surface);
|
||||||
@ -1063,7 +1063,7 @@ int main(int /*argc*/, char** /*argv*/)
|
|||||||
// Cleanup
|
// Cleanup
|
||||||
device->waitIdle();
|
device->waitIdle();
|
||||||
swapChainData.swapChain.reset(); // need to reset swapChain before destroying the surface !
|
swapChainData.swapChain.reset(); // need to reset swapChain before destroying the surface !
|
||||||
VULKAN_HPP_DEFAULT_DISPATCHER.vkDestroySurfaceKHR(*instance, surface, nullptr);
|
VULKAN_HPP_DEFAULT_DISPATCHER.vkDestroySurfaceKHR(VkInstance(*instance), VkSurfaceKHR(surface), nullptr);
|
||||||
glfwDestroyWindow(window);
|
glfwDestroyWindow(window);
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
}
|
}
|
||||||
|
@ -671,11 +671,11 @@ namespace vk
|
|||||||
, window(vk::su::createWindow(windowName, extent))
|
, window(vk::su::createWindow(windowName, extent))
|
||||||
{
|
{
|
||||||
VkSurfaceKHR _surface;
|
VkSurfaceKHR _surface;
|
||||||
VkResult err = glfwCreateWindowSurface(instance.get(), window.handle, nullptr, &_surface);
|
VkResult err = glfwCreateWindowSurface(VkInstance(instance.get()), window.handle, nullptr, &_surface);
|
||||||
if (err != VK_SUCCESS)
|
if (err != VK_SUCCESS)
|
||||||
throw std::runtime_error("Failed to create window!");
|
throw std::runtime_error("Failed to create window!");
|
||||||
vk::ObjectDestroy<vk::Instance, VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> _deleter(instance.get());
|
vk::ObjectDestroy<vk::Instance, VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> _deleter(instance.get());
|
||||||
surface = vk::UniqueSurfaceKHR(_surface, _deleter);
|
surface = vk::UniqueSurfaceKHR(vk::SurfaceKHR(_surface), _deleter);
|
||||||
}
|
}
|
||||||
|
|
||||||
SwapChainData::SwapChainData(vk::PhysicalDevice const& physicalDevice, vk::UniqueDevice const& device, vk::SurfaceKHR const& surface, vk::Extent2D const& extent, vk::ImageUsageFlags usage,
|
SwapChainData::SwapChainData(vk::PhysicalDevice const& physicalDevice, vk::UniqueDevice const& device, vk::SurfaceKHR const& surface, vk::Extent2D const& extent, vk::ImageUsageFlags usage,
|
||||||
|
Loading…
Reference in New Issue
Block a user