MCPcopy Create free account
hub / github.com/MyGUI/mygui / loadPlugin

Method loadPlugin

MyGUIEngine/src/MyGUI_PluginManager.cpp:49–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 }
48
49 bool PluginManager::loadPlugin(std::string_view _file)
50 {
51#ifdef EMSCRIPTEN
52 return false;
53#endif
54 MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " used but not initialised");
55
56 // Load plugin library
57 DynLib* lib = DynLibManager::getInstance().load(_file);
58 if (!lib)
59 {
60 MYGUI_LOG(Error, "Plugin '" << _file << "' not found");
61 return false;
62 }
63
64 // Call startup function
65 DLL_START_PLUGIN pFunc = reinterpret_cast<DLL_START_PLUGIN>(lib->getSymbol("dllStartPlugin"));
66 if (!pFunc)
67 {
68 MYGUI_LOG(Error, "Cannot find symbol 'dllStartPlugin' in library " << _file);
69 return false;
70 }
71
72 // Store for later unload
73 mLibs[lib->getName()] = lib;
74
75 // This must call installPlugin
76 pFunc();
77
78 return true;
79 }
80
81 void PluginManager::unloadPlugin(std::string_view _file)
82 {

Callers 2

createSceneMethod · 0.80
createSceneMethod · 0.80

Calls 3

getClassTypeNameFunction · 0.85
getSymbolMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected