Dynamic libraries

In order to load dynamic libraries like .dll or .so, you can use the DynamicLibraryManager module. It has two main methods:

Once the library is loaded you can use the DynamicLibrary object and its DynamicLibrary::GetSymbol method to retrieve a function pointer within the dynamic library, and call into it.

// Load library
DynamicLibrary* myLibrary = GetDynamicLibraryManager().Load("myPlugin");

// Retrieve function pointer (symbol) to the "LoadPlugin" method
typedef void* (*LoadPluginFunc)();
LoadPluginFunc loadPluginFunc = (LoadPluginFunc)myLibrary->GetSymbol("LoadPlugin");

// Call the function
loadPluginFunc();

// Assuming we're done, unload the plugin
GetDynamicLibraryManager().Unload(myLibrary);