Process windows for one frame.
This is the main per-frame operation that should be called from the application's main loop. It:
- Calls window->poll() for supported backends
- Polls GLFW events (triggers EventSource) if defined
- Cleans up closed windows
- Optionally runs per-frame hooks
- Returns
- True if processing should continue, false if all windows closed
Definition at line 208 of file WindowManager.cpp.
209{
210
211#if defined(GLFW_BACKEND)
213 glfwPollEvents();
214 });
215#else
217 w->poll();
218#endif
219
220 {
223 hook();
224 }
225 }
226
228
230}
std::mutex m_hooks_mutex
Mutex for protecting m_windows and m_window_lookup.
size_t destroy_closed_windows()
Destroys all windows that should close.
std::unordered_map< std::string, std::function< void()> > m_frame_hooks
Calls all registered frame hooks.
std::vector< std::shared_ptr< Window > > m_processing_windows
size_t window_count() const
Gets number of active windows.
auto dispatch_main_sync(Func &&func, Args &&... args) -> decltype(auto)
References destroy_closed_windows(), MayaFlux::Parallel::dispatch_main_sync(), m_frame_hooks, m_hooks_mutex, m_processing_windows, and window_count().