MayaFlux 1.0.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 694 of file BackendWindowHandler.cpp.

695{
696 const auto& state = context.window->get_state();
697
698 if (!context.swapchain->recreate(state.current_width, state.current_height)) {
700 "Failed to recreate swapchain for window '{}'",
701 context.window->get_create_info().title);
702 return false;
703 }
704
705 if (context.depth_image) {
706 auto device = m_context.get_device();
707 const auto& res = context.depth_image->get_image_resources();
708 if (res.image_view) {
709 device.destroyImageView(res.image_view);
710 }
711 if (res.memory) {
712 device.freeMemory(res.memory);
713 }
714 if (res.image) {
715 device.destroyImage(res.image);
716 }
717 context.depth_image.reset();
718 }
719
720 return true;
721}
#define MF_RT_ERROR(comp, ctx,...)
vk::PhysicalDevice device
Definition VKDevice.cpp:121
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, device, MayaFlux::Journal::GraphicsCallback, MF_RT_ERROR, MayaFlux::Core::WindowRenderContext::swapchain, and MayaFlux::Core::WindowRenderContext::window.