Files
Seele/src/Editor/Platform/Windows/GameInterface.cpp
T

28 lines
578 B
C++
Raw Normal View History

2023-01-29 18:58:59 +01:00
#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;
}