hello, I am writing a plugin and plugin calls a singleton of the application in order to register itself, however, in the plugin, applications signleton class creates a new copy of it self, so the plugin is registered with this new instance of the application. How can I fix this ?
#include "amzMain.h"
// Plugin it self
Dx11RenderPlugin* plugin;
extern"C" _AmzExport void dllStartPlugin(void)
{
plugin = new Dx11RenderPlugin();
// add it to the main
// this line creates a new instance of the main
Main::getSingleton().initializePlugin(plugin);
}
extern"C" _AmzExport void dllStopPlugin(void)
{
// this line creates a new instance of the main
Main::getSingleton().uninitializePlugin(plugin);
delete plugin;
}