MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ recreate_swapchain_internal()

bool MayaFlux::Core::BackendWindowHandler::recreate_swapchain_internal ( WindowRenderContext context)
private

Internal logic to recreate swapchain and related resources.

Parameters
contextWindow render context
Returns
True if recreation succeeded

Definition at line 429 of file BackendWindowHandler.cpp.

430{
431 const auto& state = context.window->get_state();
432
433 if (!context.swapchain->recreate(state.current_width, state.current_height)) {
435 "Failed to recreate swapchain for window '{}'",
436 context.window->get_create_info().title);
437 return false;
438 }
439
440 if (context.depth_image) {
441 auto device = m_context.get_device();
442 const auto& res = context.depth_image->get_image_resources();
443 if (res.image_view) {
444 device.destroyImageView(res.image_view);
445 }
446 if (res.memory) {
447 device.freeMemory(res.memory);
448 }
449 if (res.image) {
450 device.destroyImage(res.image);
451 }
452 context.depth_image.reset();
453 }
454
455 return true;
456}
#define MF_RT_ERROR(comp, ctx,...)
vk::Device get_device() const
Get logical device.
Definition VKContext.hpp:49
@ GraphicsCallback
Graphics/visual rendering callback - frame-rate real-time.
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Core::WindowRenderContext::depth_image, MayaFlux::Journal::GraphicsCallback, MF_RT_ERROR, MayaFlux::Core::WindowRenderContext::swapchain, and MayaFlux::Core::WindowRenderContext::window.