/** TODO */ void Anvil::Swapchain::on_parent_window_about_to_close() { if (m_destroy_swapchain_before_parent_window_closes) { destroy_swapchain(); } }
/** Please see header for specification */ Anvil::Swapchain::~Swapchain() { Anvil::ObjectTracker::get()->unregister_object(Anvil::OBJECT_TYPE_SWAPCHAIN, this); destroy_swapchain(); m_image_ptrs.clear (); m_image_available_fence_ptr.reset(); m_image_view_ptrs.clear (); for (auto queue_ptr : m_observed_queues) { queue_ptr->unregister_from_callbacks( QUEUE_CALLBACK_ID_PRESENT_REQUEST_ISSUED, std::bind(&Swapchain::on_present_request_issued, this, std::placeholders::_1), this ); } m_create_info_ptr->get_window()->unregister_from_callbacks( WINDOW_CALLBACK_ID_ABOUT_TO_CLOSE, std::bind(&Swapchain::on_parent_window_about_to_close, this), this ); }
void Shell::destroy_context() { if (ctx_.dev == VK_NULL_HANDLE) return; vk::DeviceWaitIdle(ctx_.dev); destroy_swapchain(); game_.detach_shell(); destroy_back_buffers(); ctx_.game_queue = VK_NULL_HANDLE; ctx_.present_queue = VK_NULL_HANDLE; vk::DestroyDevice(ctx_.dev, nullptr); ctx_.dev = VK_NULL_HANDLE; }