Implemented basic game dll interaction

This commit is contained in:
Dynamitos
2023-01-29 18:58:59 +01:00
parent 2208ab438a
commit 0dce84459e
72 changed files with 1297 additions and 350 deletions
@@ -0,0 +1,28 @@
#include "GameInterface.h"
using namespace Seele;
GameInterface::GameInterface(std::string dllPath)
: dllPath(dllPath)
{
reloadGame();
}
GameInterface::~GameInterface()
{
}
Game* GameInterface::reloadGame()
{
if(lib != NULL)
{
destroyInstance(game);
FreeLibrary(lib);
}
lib = LoadLibraryA(dllPath.c_str());
createInstance = (decltype(createInstance))GetProcAddress(lib, "createInstance");
destroyInstance = (decltype(destroyInstance))GetProcAddress(lib, "destroyInstance");
game = createInstance();
return game;
}