diff --git a/ExampleModules.nix b/ExampleModules.nix index 347aa39..2833481 100644 --- a/ExampleModules.nix +++ b/ExampleModules.nix @@ -16,6 +16,7 @@ -fpic -shared \ -I src \ -Wall \ + -DTESTMENU_DYNAMIC \ -o $name ''; @@ -42,6 +43,7 @@ -fpic -shared \ -I src -I include \ -Wall \ + -DPRINT_DYNAMIC \ -o $name ''; @@ -68,6 +70,7 @@ -fpic -shared \ -I src -I include \ -Wall \ + -DDEPENDSONPRINT_DYNAMIC \ -o $name ''; @@ -94,7 +97,7 @@ modules/examples/Modules/Print/src/*.cpp \ -fpic -shared \ -I src -I include -I . \ - -DPRINT_STATIC \ + -DDEPENDSONPRINTSTATIC_DYNAMIC \ -Wall \ -o $name ''; @@ -133,7 +136,7 @@ -DRENDERER_OPENGL \ -DWINDOW_GLFW \ -DGUIMODULE \ - -DWINDOWMODULE_STATIC \ + -DTESTIMGUI_DYNAMIC \ -fpic -shared \ -I src -I include -I $imgui -I . \ -lGL -lglfw -lGLEW \ @@ -167,6 +170,7 @@ -I src -I include \ -DRENDERER_OPENGL \ -DWINDOW_GLFW \ + -DTESTCLAY_DYNAMIC \ -Wall \ -o $name ''; diff --git a/include/utils/GuiModule/GuiModule.h b/include/utils/GuiModule/GuiModule.h index 9fc7216..a44cf9b 100644 --- a/include/utils/GuiModule/GuiModule.h +++ b/include/utils/GuiModule/GuiModule.h @@ -3,9 +3,6 @@ #include "utils/Module/Module.h" -#ifndef WINDOWMODULE_STATIC -#define WINDOWMODULE_STATIC -#endif #include "modules/WindowModule/src/WindowModule.h" namespace Archimedes { diff --git a/modules/WindowModule/src/WindowModule.h b/modules/WindowModule/src/WindowModule.h index fd2568f..1b00127 100644 --- a/modules/WindowModule/src/WindowModule.h +++ b/modules/WindowModule/src/WindowModule.h @@ -35,7 +35,7 @@ class WindowModule : public Archimedes::Module { }; -#ifndef WINDOWMODULE_STATIC +#ifdef WINDOWMODULE_DYNAMIC #define MODULE_TYPE WindowModule #include "endModule.h" #endif diff --git a/modules/examples/GuiModules/TestImgui/src/TestImgui.h b/modules/examples/GuiModules/TestImgui/src/TestImgui.h index a40273a..871e63c 100644 --- a/modules/examples/GuiModules/TestImgui/src/TestImgui.h +++ b/modules/examples/GuiModules/TestImgui/src/TestImgui.h @@ -25,7 +25,7 @@ class TestImgui : public Archimedes::GuiModule { Archimedes::Window* window; }; -#ifndef TESTIMGUI_STATIC +#ifdef TESTIMGUI_DYNAMIC #define MODULE_TYPE TestImgui #include "endModule.h" #endif diff --git a/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.cpp b/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.cpp index e221f35..eb5c316 100644 --- a/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.cpp +++ b/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.cpp @@ -12,5 +12,5 @@ DependsOnPrint::~DependsOnPrint() { void DependsOnPrint::run() { std::cout << "DependsOnPrint lib loaded and run!\n"; - app->stopModule(self); + app->stopModule(name); } diff --git a/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h b/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h index fd418e4..2f5dbdd 100644 --- a/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h +++ b/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h @@ -10,7 +10,7 @@ class DependsOnPrint : public Archimedes::Module { }; -#ifndef DEPENDSONPRINT_STATIC +#ifdef DEPENDSONPRINT_DYNAMIC #define MODULE_TYPE DependsOnPrint #include "endModule.h" #endif diff --git a/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp b/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp index 81ec49b..0721dd8 100644 --- a/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp +++ b/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp @@ -1,5 +1,6 @@ #include "DependsOnPrintStatic.h" -#include "modules/Print/src/Print.h" + +#include "modules/examples/Modules/Print/src/Print.h" DependsOnPrintStatic::DependsOnPrintStatic(void* h, Archimedes::App* a) : Module(h, a) { name = "DependsOnPrintStatic"; @@ -13,5 +14,5 @@ DependsOnPrintStatic::~DependsOnPrintStatic() { void DependsOnPrintStatic::run() { std::cout << "DependsOnPrintStatic lib loaded and run!\n"; - app->stopModule(self); + app->stopModule(name); } diff --git a/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h b/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h index 1861187..8b37b5d 100644 --- a/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h +++ b/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h @@ -10,7 +10,7 @@ class DependsOnPrintStatic : public Archimedes::Module { }; -#ifndef DEPENDSONPRINTSTATIC_STATIC +#ifdef DEPENDSONPRINTSTATIC_DYNAMIC #define MODULE_TYPE DependsOnPrintStatic #include "endModule.h" #endif diff --git a/modules/examples/Modules/Print/src/Print.cpp b/modules/examples/Modules/Print/src/Print.cpp index 509bf89..e17c578 100644 --- a/modules/examples/Modules/Print/src/Print.cpp +++ b/modules/examples/Modules/Print/src/Print.cpp @@ -11,5 +11,5 @@ Print::~Print() { void Print::run() { std::cout << "Print lib loaded and run!\n"; - app->stopModule(self); + app->stopModule(name); } diff --git a/modules/examples/Modules/Print/src/Print.h b/modules/examples/Modules/Print/src/Print.h index 25de182..addb83b 100644 --- a/modules/examples/Modules/Print/src/Print.h +++ b/modules/examples/Modules/Print/src/Print.h @@ -10,7 +10,7 @@ class Print : public Archimedes::Module { }; -#ifndef PRINT_STATIC +#ifdef PRINT_DYNAMIC #define MODULE_TYPE Print #include "endModule.h" #endif diff --git a/modules/examples/Modules/TestMenu/src/TestMenu.cpp b/modules/examples/Modules/TestMenu/src/TestMenu.cpp index 3cf9daa..9004b06 100644 --- a/modules/examples/Modules/TestMenu/src/TestMenu.cpp +++ b/modules/examples/Modules/TestMenu/src/TestMenu.cpp @@ -1,6 +1,6 @@ #include "TestMenu.h" -TestMenu::TestMenu(void* h, App& a) : Module(h, a) { +TestMenu::TestMenu(void* h, Archimedes::App* a) : Module(h, a) { name = "TestMenu"; } @@ -26,10 +26,10 @@ void TestMenu::run() { num--; break; case 3: - app.stopModule(self); + app->stopModule(name); break; case 4: - app.end(); + app->end(); break; default: break; diff --git a/modules/examples/Modules/TestMenu/src/TestMenu.h b/modules/examples/Modules/TestMenu/src/TestMenu.h index 73d1b35..b3ecd94 100644 --- a/modules/examples/Modules/TestMenu/src/TestMenu.h +++ b/modules/examples/Modules/TestMenu/src/TestMenu.h @@ -1,9 +1,9 @@ #include "Archimedes.h" -class TestMenu : public Module { +class TestMenu : public Archimedes::Module { public: - TestMenu(void*, App&); + TestMenu(void*, Archimedes::App*); ~TestMenu(); void run(); void onLoad() {} @@ -13,8 +13,7 @@ class TestMenu : public Module { int num = 5; }; -extern "C" { - Module* create(void* handle, App& app) { - return new TestMenu(handle, app); - } -} +#ifdef TESTMENU_DYNAMIC +#define MODULE_TYPE TestMenu +#include "endModule.h" +#endif