MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / resize

Method resize

samples/api/hpp_hello_triangle/hpp_hello_triangle.cpp:239–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239bool HPPHelloTriangle::resize(const uint32_t, const uint32_t)
240{
241 if (!device)
242 {
243 return false;
244 }
245
246 vk::SurfaceCapabilitiesKHR surface_properties = gpu.getSurfaceCapabilitiesKHR(surface);
247
248 // Only rebuild the swapchain if the dimensions have changed
249 if (surface_properties.currentExtent == swapchain_data.extent)
250 {
251 return false;
252 }
253
254 device.waitIdle();
255 teardown_framebuffers();
256
257 init_swapchain();
258 init_framebuffers();
259 return true;
260}
261
262/**
263 * @brief Acquires an image from the swapchain.

Callers 1

init_swapchainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected