MCPcopy Create free account
hub / github.com/Vhonowslend/StreamFX-Public / obs_module_load

Function obs_module_load

source/plugin.cpp:59–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57} // namespace streamfx
58
59MODULE_EXPORT bool obs_module_load(void)
60{
61 try {
62 DLOG_INFO("Loading Version %s", STREAMFX_VERSION_STRING);
63
64 // Initialize GLAD (OpenGL)
65 {
66 streamfx::obs::gs::context gctx{};
67 if (gs_get_device_type() == GS_DEVICE_OPENGL) {
68 _streamfx_gfx_opengl = streamfx::gfx::opengl::get();
69 }
70 }
71
72 // Run all initializers.
73 for (auto kv : streamfx::get_initializers()) {
74 for (auto init : kv.second) {
75 try {
76 init();
77 } catch (const std::exception& ex) {
78 DLOG_ERROR("Initializer threw exception: %s", ex.what());
79 } catch (...) {
80 DLOG_ERROR("Initializer threw unknown exception.");
81 }
82 }
83 }
84
85 DLOG_INFO("Loaded Version %s", STREAMFX_VERSION_STRING);
86 return true;
87 } catch (std::exception const& ex) {
88 DLOG_ERROR("Unexpected exception in function '%s': %s", __FUNCTION_NAME__, ex.what());
89 return false;
90 } catch (...) {
91 DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
92 return false;
93 }
94}
95
96MODULE_EXPORT void obs_module_post_load(void) {}
97

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected