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

◆ destroy_window()

void MayaFlux::Core::WindowManager::destroy_window ( const std::shared_ptr< Window > &  window,
bool  cleanup_backend = false 
)

Destroys a window by pointer.

Parameters
windowPointer to window to destroy
cleanup_backendIf true, also cleans up backend resources

Definition at line 64 of file WindowManager.cpp.

65{
66 if (!window)
67 return;
68
69 auto pr_it = std::ranges::find(m_processing_windows, window);
70 if (pr_it != m_processing_windows.end()) {
71 m_processing_windows.erase(pr_it);
72 }
73
74 const std::string title = window->get_create_info().title;
76
77 auto it = std::ranges::find(m_windows, window);
78 if (it != m_windows.end()) {
79 m_windows.erase(it);
81 "Destroyed window '{}' - remaining: {}", title, m_windows.size());
82 }
83
84 if (!cleanup_backend) {
85 return;
86 }
87
88 if (m_terminate.load()) {
89 window->destroy();
90 } else {
92 window->destroy();
93 });
94 }
96 "Backend resources for window '{}' cleaned up", title);
97}
#define MF_INFO(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
std::atomic< bool > m_terminate
std::vector< std::shared_ptr< Window > > m_windows
void remove_from_lookup(const std::shared_ptr< Window > &window)
Removes window from lookup table.
std::vector< std::shared_ptr< Window > > m_processing_windows
@ WindowingSubsystem
Windowing system operations (Win32, Wayland, Cocoa)
@ Core
Core engine, backend, subsystems.
auto dispatch_main_sync(Func &&func, Args &&... args) -> decltype(auto)
Definition Dispatch.hpp:141

References MayaFlux::Journal::Core, MayaFlux::Parallel::dispatch_main_sync(), m_processing_windows, m_terminate, m_windows, MF_DEBUG, MF_INFO, remove_from_lookup(), window, and MayaFlux::Journal::WindowingSubsystem.

Referenced by destroy_closed_windows(), and destroy_window_by_title().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: