| 237 | } |
| 238 | |
| 239 | bool 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. |