MayaFlux 0.5.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 673 of file BackendWindowHandler.cpp.

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