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

◆ process()

bool MayaFlux::Core::WindowManager::process ( )

Process windows for one frame.

This is the main per-frame operation that should be called from the application's main loop. It:

  1. Calls window->poll() for supported backends
  2. Polls GLFW events (triggers EventSource) if defined
  3. Cleans up closed windows
  4. 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
216 for (auto& w : m_processing_windows)
217 w->poll();
218#endif
219
220 {
221 std::lock_guard<std::mutex> lock(m_hooks_mutex);
222 for (const auto& [name, hook] : m_frame_hooks) {
223 hook();
224 }
225 }
226
228
229 return window_count() > 0;
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)
Definition Dispatch.hpp:107

References destroy_closed_windows(), MayaFlux::Parallel::dispatch_main_sync(), m_frame_hooks, m_hooks_mutex, m_processing_windows, and window_count().

+ Here is the call graph for this function: