diff options
| author | Bryan Galdrikian <[email protected]> | 2017-02-21 12:07:59 -0800 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2017-02-21 12:07:59 -0800 |
| commit | 446ce137c6823ba9eff273bdafdaf266287c7c98 (patch) | |
| tree | d20aab3e2ed08d7b3ca71c2f40db6a93ea00c459 /NvBlast/tools/ArtistTools/source/BlastPlugin/Render/Interface/PluginBlast.cpp | |
| download | blast-446ce137c6823ba9eff273bdafdaf266287c7c98.tar.xz blast-446ce137c6823ba9eff273bdafdaf266287c7c98.zip | |
first commitv1.0.0-beta
Diffstat (limited to 'NvBlast/tools/ArtistTools/source/BlastPlugin/Render/Interface/PluginBlast.cpp')
| -rw-r--r-- | NvBlast/tools/ArtistTools/source/BlastPlugin/Render/Interface/PluginBlast.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/NvBlast/tools/ArtistTools/source/BlastPlugin/Render/Interface/PluginBlast.cpp b/NvBlast/tools/ArtistTools/source/BlastPlugin/Render/Interface/PluginBlast.cpp new file mode 100644 index 0000000..3a9c9c9 --- /dev/null +++ b/NvBlast/tools/ArtistTools/source/BlastPlugin/Render/Interface/PluginBlast.cpp @@ -0,0 +1,69 @@ +#include "PluginBlast.h" + +PluginBlast* g_Plugin = nullptr; + +PluginBlast::PluginBlast() +{ +} + +PluginBlast::~PluginBlast() +{ +} + +typedef PluginBlast*(*Func)(void); + +bool PluginBlast::Create(std::string strApi) +{ + if ("" == strApi) + return false; + + std::string pluginDll = ""; + HMODULE module = NULL; + Func CreateFunc = NULL; + +#ifdef NV_ARTISTTOOLS + pluginDll = "RenderBlast"; +#else + pluginDll = "FurRender"; +#endif + + pluginDll.append(strApi); + +#ifdef _WIN64 + pluginDll.append(".win64"); +#else + pluginDll.append(".win32"); +#endif + +#ifdef _DEBUG + pluginDll.append(".d"); +#else +#endif + + pluginDll.append(".dll"); + + module = LoadLibraryA(pluginDll.c_str()); + if (NULL == module) + return false; + + CreateFunc = (Func)GetProcAddress(module, "CreateRenderBlast"); + if (NULL == CreateFunc) + return false; + + g_Plugin = CreateFunc(); + return (NULL != g_Plugin); +} + +PluginBlast* PluginBlast::Instance() +{ + return g_Plugin; +} + +void PluginBlast::Destroy() +{ + if (nullptr == g_Plugin) + return; + + delete g_Plugin; + g_Plugin = nullptr; +} |