Modules are static by default
This commit is contained in:
@@ -35,7 +35,7 @@ class WindowModule : public Archimedes::Module {
|
||||
};
|
||||
|
||||
|
||||
#ifndef WINDOWMODULE_STATIC
|
||||
#ifdef WINDOWMODULE_DYNAMIC
|
||||
#define MODULE_TYPE WindowModule
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,5 +12,5 @@ DependsOnPrint::~DependsOnPrint() {
|
||||
|
||||
void DependsOnPrint::run() {
|
||||
std::cout << "DependsOnPrint lib loaded and run!\n";
|
||||
app->stopModule(self);
|
||||
app->stopModule(name);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class DependsOnPrint : public Archimedes::Module {
|
||||
|
||||
};
|
||||
|
||||
#ifndef DEPENDSONPRINT_STATIC
|
||||
#ifdef DEPENDSONPRINT_DYNAMIC
|
||||
#define MODULE_TYPE DependsOnPrint
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class DependsOnPrintStatic : public Archimedes::Module {
|
||||
|
||||
};
|
||||
|
||||
#ifndef DEPENDSONPRINTSTATIC_STATIC
|
||||
#ifdef DEPENDSONPRINTSTATIC_DYNAMIC
|
||||
#define MODULE_TYPE DependsOnPrintStatic
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
|
||||
@@ -11,5 +11,5 @@ Print::~Print() {
|
||||
void Print::run() {
|
||||
std::cout << "Print lib loaded and run!\n";
|
||||
|
||||
app->stopModule(self);
|
||||
app->stopModule(name);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class Print : public Archimedes::Module {
|
||||
|
||||
};
|
||||
|
||||
#ifndef PRINT_STATIC
|
||||
#ifdef PRINT_DYNAMIC
|
||||
#define MODULE_TYPE Print
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user