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

◆ initialize()

bool MayaFlux::Core::GLFWSingleton::initialize ( )
static

Initializes the GLFW library if not already initialized.

Returns
True if initialization succeeded or was already done, false on failure

Sets up the GLFW error callback and calls glfwInit() if needed. Safe to call multiple times; initialization occurs only once.

Definition at line 59 of file GlfwSingleton.cpp.

60{
61 if (s_initialized)
62 return true;
63
64 if (!s_configured) {
66 "GLFWSingleton::initialize() called without prior configure() — using default pre-init hints");
67
69 }
70
71 glfwSetErrorCallback([](int error, const char* description) {
72 MF_ERROR(Journal::Component::Core, Journal::Context::WindowingSubsystem, "GLFW Error {}: {}", error, description);
73 });
74
75 if (!glfwInit()) {
77 return false;
78 }
79
80 s_initialized = true;
82 return true;
83}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
static uint32_t s_window_count
Number of currently active GLFW windows.
static GlfwPreInitConfig s_preinit_config
static void configure(const GlfwPreInitConfig &config)
Configures GLFW with pre-initialization hints.
static bool s_initialized
Tracks whether GLFW has been initialized.
@ WindowingSubsystem
Windowing system operations (GLFW, SDL)
@ Core
Core engine, backend, subsystems.

References configure(), MayaFlux::Journal::Core, MF_ERROR, MF_WARN, s_configured, s_initialized, s_preinit_config, s_window_count, and MayaFlux::Journal::WindowingSubsystem.

Referenced by get_required_instance_extensions(), and MayaFlux::Core::GlfwWindow::GlfwWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: