MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Core::WindowManager Class Reference

Manages window lifecycle and GLFW event polling. More...

#include <WindowManager.hpp>

+ Collaboration diagram for MayaFlux::Core::WindowManager:

Public Member Functions

 WindowManager (const GlobalGraphicsConfig &config)
 Constructs WindowManager with global graphics config.
 
 ~WindowManager ()
 
 WindowManager (const WindowManager &)=delete
 
WindowManageroperator= (const WindowManager &)=delete
 
 WindowManager (WindowManager &&) noexcept=delete
 
WindowManageroperator= (WindowManager &&) noexcept=delete
 
std::shared_ptr< Windowcreate_window (const WindowCreateInfo &create_info)
 Creates a new window.
 
void destroy_window (const std::shared_ptr< Window > &window)
 Destroys a window by pointer.
 
bool destroy_window_by_title (const std::string &title)
 Destroys a window by title.
 
std::vector< std::shared_ptr< Window > > get_windows () const
 Gets all active windows.
 
std::shared_ptr< Windowfind_window (const std::string &title) const
 Finds window by title.
 
std::shared_ptr< Windowget_window (size_t index) const
 Gets window by index.
 
size_t window_count () const
 Gets number of active windows.
 
bool any_window_should_close () const
 Checks if any window should close.
 
size_t destroy_closed_windows ()
 Destroys all windows that should close.
 
const GraphicsSurfaceInfoget_config () const
 Gets the global graphics configuration.
 
bool process ()
 Process windows for one frame.
 
void register_frame_hook (const std::string &name, std::function< void()> hook)
 Register a hook that runs every frame.
 
void unregister_frame_hook (const std::string &name)
 Unregister a previously registered frame hook.
 
std::vector< std::shared_ptr< Window > > get_processing_windows () const
 Get windows registered for processing.
 

Private Member Functions

std::shared_ptr< Windowcreate_window_internal (const WindowCreateInfo &create_info)
 Factory for creating backend-specific windows.
 
void remove_from_lookup (const std::shared_ptr< Window > &window)
 Removes window from lookup table.
 

Private Attributes

GlobalGraphicsConfig m_config
 
std::vector< std::shared_ptr< Window > > m_windows
 
std::unordered_map< std::string, std::weak_ptr< Window > > m_window_lookup
 
std::atomic< bool > m_should_stop { false }
 Atomic flag to signal event loop thread to stop.
 
std::unordered_map< std::string, std::function< void()> > m_frame_hooks
 Calls all registered frame hooks.
 
std::mutex m_hooks_mutex
 Mutex for protecting m_windows and m_window_lookup.
 
std::vector< std::shared_ptr< Window > > m_processing_windows
 

Detailed Description

Manages window lifecycle and GLFW event polling.

Responsibilities:

  • Create/destroy windows
  • Poll GLFW events (calls glfwPollEvents)
  • Query windows by title/index

Definition at line 17 of file WindowManager.hpp.


The documentation for this class was generated from the following files: