|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Singleton utility for managing global GLFW initialization and termination. More...
#include <GlfwSingleton.hpp>
Collaboration diagram for MayaFlux::Core::GLFWSingleton:Static Public Member Functions | |
| static void | configure (const GlfwPreInitConfig &config) |
| Configures GLFW with pre-initialization hints. | |
| static std::vector< MonitorInfo > | enumerate_monitors () |
| Enumerates all connected monitors and their information. | |
| static MonitorInfo | get_monitor (int32_t id) |
| Retrieves information about a specific monitor by ID. | |
| static std::string | get_platform () |
| Gets the current GLFW platform (Wayland, X11, etc.) | |
| static MonitorInfo | get_primary_monitor () |
| Retrieves information about the primary monitor. | |
| static std::vector< const char * > | get_required_instance_extensions () |
| Retrieves the list of required Vulkan instance extensions for GLFW. | |
| static uint32_t | get_window_count () |
| Gets the current count of active GLFW windows. | |
| static bool | initialize () |
| Initializes the GLFW library if not already initialized. | |
| static bool | is_initialized () |
| Checks if GLFW has been initialized. | |
| static bool | is_wayland () |
| Checks if running on Wayland. | |
| static void | mark_window_created () |
| Increments the count of active GLFW windows. | |
| static void | mark_window_destroyed () |
| Decrements the count of active GLFW windows. | |
| static void | set_error_callback (std::function< void(int, const char *)> callback) |
| Sets a custom error callback for GLFW errors. | |
| static void | terminate () |
| Terminates the GLFW library if initialized and no windows remain. | |
Static Private Attributes | |
| static bool | s_configured {} |
| static std::function< void(int, const char *)> | s_error_callback |
| Internal GLFW error callback that forwards to the user-defined callback if set. | |
| static bool | s_initialized {} |
| Tracks whether GLFW has been initialized. | |
| static GlfwPreInitConfig | s_preinit_config {} |
| static uint32_t | s_window_count {} |
| Number of currently active GLFW windows. | |
Singleton utility for managing global GLFW initialization and termination.
GLFWSingleton ensures that the GLFW library is initialized exactly once per process, and is properly terminated when no more windows are in use. This prevents redundant initialization and resource leaks, and provides a safe, centralized mechanism for managing the GLFW global state.
Usage:
This class is not intended to be instantiated; all methods and state are static.
Definition at line 25 of file GlfwSingleton.hpp.