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

◆ configure()

void MayaFlux::Core::GLFWSingleton::configure ( const GlfwPreInitConfig config)
static

Configures GLFW with pre-initialization hints.

Parameters
configConfiguration parameters to set before initialization

Must be called before initialize() to take effect. Sets various GLFW windowing and context hints based on the provided configuration. If called after initialization, the hints will be ignored.

Definition at line 16 of file GlfwSingleton.cpp.

17{
18 if (s_initialized) {
20 "GLFWSingleton::configure() called after GLFW was initialized — pre-init hints will be ignored");
21 return;
22 }
23
24 if (config.platform != GlfwPreInitConfig::Platform::Default) {
25 int glfw_platform = GLFW_ANY_PLATFORM;
26 switch (config.platform) {
28 glfw_platform = GLFW_PLATFORM_WAYLAND;
29 break;
31 glfw_platform = GLFW_PLATFORM_X11;
32 break;
33 default:
34 break;
35 }
36 glfwInitHint(GLFW_PLATFORM, glfw_platform);
37 }
38
39 glfwInitHint(GLFW_WAYLAND_LIBDECOR, config.disable_libdecor ? GLFW_FALSE : GLFW_TRUE);
40 glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, config.cocoa_chdir_resources ? GLFW_TRUE : GLFW_FALSE);
41 glfwInitHint(GLFW_COCOA_MENUBAR, config.cocoa_menubar ? GLFW_TRUE : GLFW_FALSE);
42
43 s_configured = true;
44
46 "GLFW pre-initialization configured: platform={}, libdecor={}, cocoa_chdir_resources={}, cocoa_menubar={}",
47 (config.platform == GlfwPreInitConfig::Platform::Default
48 ? "default"
49 : config.platform == GlfwPreInitConfig::Platform::Wayland
50 ? "wayland"
51 : "x11"),
52 config.disable_libdecor ? "disabled" : "enabled",
53 config.cocoa_chdir_resources ? "enabled" : "disabled",
54 config.cocoa_menubar ? "enabled" : "disabled");
55
56 s_preinit_config = config;
57}
#define MF_INFO(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
static GlfwPreInitConfig s_preinit_config
static bool s_initialized
Tracks whether GLFW has been initialized.
@ WindowingSubsystem
Windowing system operations (GLFW, SDL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Core::GlfwPreInitConfig::cocoa_chdir_resources, MayaFlux::Core::GlfwPreInitConfig::cocoa_menubar, MayaFlux::Journal::Core, MayaFlux::Core::GlfwPreInitConfig::Default, MayaFlux::Core::GlfwPreInitConfig::disable_libdecor, MF_INFO, MF_WARN, MayaFlux::Core::GlfwPreInitConfig::platform, s_configured, s_initialized, s_preinit_config, MayaFlux::Core::GlfwPreInitConfig::Wayland, MayaFlux::Journal::WindowingSubsystem, and MayaFlux::Core::GlfwPreInitConfig::X11.

Referenced by MayaFlux::Core::GlfwWindow::GlfwWindow(), initialize(), and MayaFlux::Core::VKContext::initialize().

+ Here is the caller graph for this function: