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

◆ initialize()

MAYAFLUX_API bool MayaFlux::Portal::System::initialize ( )

Initialize Portal::System.

Must be called before any Portal::System free functions are used. No subsystem dependency is required; call at any point after engine construction and before the first dialog or OS interaction.

Initializes, in order:

Returns
True if initialization succeeded.

Definition at line 27 of file System.cpp.

28{
29 if (g_initialized) {
30 MF_WARN(Journal::Component::Portal, Journal::Context::API,
31 "Portal::System already initialized");
32 return true;
33 }
34
35 MF_INFO(Journal::Component::Portal, Journal::Context::API,
36 "Initializing Portal::System...");
37
38#ifdef MAYAFLUX_PLATFORM_LINUX
39 g_backend = std::make_unique<Core::DBusBackend>();
40#elif defined(MAYAFLUX_PLATFORM_WINDOWS)
41 g_backend = std::make_unique<Core::COMBackend>();
42#elif defined(MAYAFLUX_PLATFORM_MACOS)
43 g_backend = std::make_unique<Core::NSBackend>();
44#endif
45
46 if (!g_backend || !g_backend->initialize()) {
47 MF_ERROR(Journal::Component::Portal, Journal::Context::API,
48 "Portal::System: backend initialization failed");
49 g_backend.reset();
50 return false;
51 }
52
53 g_initialized = true;
54 MF_INFO(Journal::Component::Portal, Journal::Context::API,
55 "Portal::System initialized");
56 return true;
57}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)

References MayaFlux::Journal::API, MF_ERROR, MF_INFO, MF_WARN, and MayaFlux::Journal::Portal.

Referenced by MayaFlux::Core::Engine::Start().

+ Here is the caller graph for this function: