MayaFlux 0.2.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 133 of file WindowManager.cpp.

134{
135 size_t destroyed_count = 0;
136
137 std::vector<std::shared_ptr<Window>> to_destroy;
138 for (const auto& window : m_windows) {
139 if (window->should_close()) {
140 to_destroy.push_back(window);
141 }
142 }
143
144 for (auto& window : to_destroy) {
145 destroy_window(window);
146 destroyed_count++;
147 }
148
149 if (destroyed_count > 0) {
151 "Destroyed {} closed window(s)", destroyed_count);
152 }
153
154 return destroyed_count;
155}
#define MF_INFO(comp, ctx,...)
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 (GLFW, SDL)
@ Core
Core engine, backend, subsystems.

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

Referenced by process().

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