implemented basic shader expressions
This commit is contained in:
@@ -0,0 +1 @@
|
||||
add_subdirectory(Windows/)
|
||||
@@ -0,0 +1,10 @@
|
||||
target_sources(Engine
|
||||
PRIVATE
|
||||
GameInterface.h
|
||||
GameInterface.cpp)
|
||||
|
||||
|
||||
target_sources(Engine
|
||||
PUBLIC FILE_SET HEADERS
|
||||
FILES
|
||||
GameInterface.h)
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "GameInterface.h"
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
GameInterface::GameInterface(std::string dllPath)
|
||||
: dllPath(dllPath)
|
||||
{
|
||||
}
|
||||
|
||||
GameInterface::~GameInterface()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Game* GameInterface::getGame()
|
||||
{
|
||||
return game;
|
||||
}
|
||||
|
||||
void GameInterface::reload(AssetRegistry* registry)
|
||||
{
|
||||
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(registry);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include "Game.h"
|
||||
#include "Windows.h"
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
class GameInterface
|
||||
{
|
||||
public:
|
||||
GameInterface(std::string dllPath);
|
||||
~GameInterface();
|
||||
Game* getGame();
|
||||
void reload(AssetRegistry* registry);
|
||||
private:
|
||||
HMODULE lib = NULL;
|
||||
std::string dllPath;
|
||||
Game* game;
|
||||
Game* (*createInstance)(AssetRegistry*) = nullptr;
|
||||
void (*destroyInstance)(Game*) = nullptr;
|
||||
};
|
||||
} // namespace Seele
|
||||
Reference in New Issue
Block a user