MayaFlux 0.1.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 117 of file WindowManager.cpp.

118{
119 size_t destroyed_count = 0;
120
121 std::vector<std::shared_ptr<Window>> to_destroy;
122 for (const auto& window : m_windows) {
123 if (window->should_close()) {
124 to_destroy.push_back(window);
125 }
126 }
127
128 for (auto& window : to_destroy) {
129 destroy_window(window);
130 destroyed_count++;
131 }
132
133 if (destroyed_count > 0) {
135 "Destroyed {} closed window(s)", destroyed_count);
136 }
137
138 return destroyed_count;
139}
#define MF_INFO(comp, ctx,...)
std::vector< std::shared_ptr< Window > > m_windows
void destroy_window(const std::shared_ptr< Window > &window)
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: