I have a game enginewhere you can write your custom scripts.I managed to make it work and load the scripts dynamicly using LoadLibrary()&GetProcAddress although it seems im stuck.
I have a .dll file an .exe,they both using same engine's library i created.The Application(.exe) inits the game engine so its must the host of the my global singleton variable.
This my script's code
#include "MyConsoleWriterComponent.h"
#include "../DarkLightEngine/DLE_Engine.h"
void MyConsoleWriterComponent::OnTick()
{
Atom* a = Atom::CreateAtom("Heyo");
OutputDebugString(L"Text Text!\n");
}
Atom::CreateAtom uses the singleton for registering the current game entity to a scene.However if call this method in .exe it's works as expected(atom pushed into scene everything is perfect) but when i export this class and using it from my .exe,it seems it does not register to my .exe singleton.
I have read it somewhere that you must mark the singleton as a 'volatile' variable but it seems prompts some errors,like some structres dont accept volatile variable(used on stacks,vectors),and there is a keyword called extern but eveytime i used on my singleton it propmts the error 'illegal' storage class.
It seems like im missing a critical concept here on this matter.
can you help me with me,any direction's opinions are much appreciated.