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

◆ destroy_closed_windows()

size_t MayaFlux::Core::WindowManager::destroy_closed_windows ( )

Destroys all windows that should close.

Returns
Number of windows destroyed

Definition at line 139 of file WindowManager.cpp.

140{
141 size_t destroyed_count = 0;
142
143 std::vector<std::shared_ptr<Window>> to_destroy;
144 for (const auto& window : m_windows) {
145 if (window->should_close()) {
146 to_destroy.push_back(window);
147 }
148 }
149
150 for (auto& window : to_destroy) {
151 destroy_window(window, true);
152 destroyed_count++;
153 }
154
155 if (destroyed_count > 0) {
157 "Destroyed {} closed window(s)", destroyed_count);
158 }
159
160 return destroyed_count;
161}
#define MF_INFO(comp, ctx,...)
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
std::vector< std::shared_ptr< Window > > m_windows
void destroy_window(const std::shared_ptr< Window > &window, bool cleanup_backend=false)
Destroys a window by pointer.
@ WindowingSubsystem
Windowing system operations (Win32, Wayland, Cocoa)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, destroy_window(), m_windows, MF_INFO, window, and MayaFlux::Journal::WindowingSubsystem.

Referenced by process().

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