MayaFlux 0.4.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 671 of file BackendWindowHandler.cpp.

672{
673 const auto& state = context.window->get_state();
674
675 if (!context.swapchain->recreate(state.current_width, state.current_height)) {
677 "Failed to recreate swapchain for window '{}'",
678 context.window->get_create_info().title);
679 return false;
680 }
681
682 if (context.depth_image) {
683 auto device = m_context.get_device();
684 const auto& res = context.depth_image->get_image_resources();
685 if (res.image_view) {
686 device.destroyImageView(res.image_view);
687 }
688 if (res.memory) {
689 device.freeMemory(res.memory);
690 }
691 if (res.image) {
692 device.destroyImage(res.image);
693 }
694 context.depth_image.reset();
695 }
696
697 return true;
698}
#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.