MayaFlux 0.4.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 138 of file WindowManager.cpp.

139{
140 size_t destroyed_count = 0;
141
142 std::vector<std::shared_ptr<Window>> to_destroy;
143 for (const auto& window : m_windows) {
144 if (window->should_close()) {
145 to_destroy.push_back(window);
146 }
147 }
148
149 for (auto& window : to_destroy) {
150 destroy_window(window);
151 destroyed_count++;
152 }
153
154 if (destroyed_count > 0) {
156 "Destroyed {} closed window(s)", destroyed_count);
157 }
158
159 return destroyed_count;
160}
#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: