ImguiEmbed
This commit is contained in:
26
src/example_apps/ImguiEmbed/ImguiEmbed.cpp
Normal file
26
src/example_apps/ImguiEmbed/ImguiEmbed.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "ImguiEmbed.h"
|
||||
|
||||
void ImguiEmbed::run() {
|
||||
|
||||
for(auto* m : modules)
|
||||
m->onLoad();
|
||||
|
||||
// Main loop
|
||||
while (!done && !modules.empty()) {
|
||||
|
||||
for(auto* m : modules) {
|
||||
m->run();
|
||||
}
|
||||
|
||||
for(auto it = toClose.begin(); it != toClose.end(); it++) {
|
||||
unload(it);
|
||||
}
|
||||
toClose.clear();
|
||||
|
||||
for(std::string s : toOpen) {
|
||||
load(dynamicLoad(s), getBlacklist());
|
||||
}
|
||||
toOpen.clear();
|
||||
}
|
||||
|
||||
}
|
||||
30
src/example_apps/ImguiEmbed/ImguiEmbed.h
Normal file
30
src/example_apps/ImguiEmbed/ImguiEmbed.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#define ENTRYPOINT
|
||||
#include "Archimedes.h"
|
||||
|
||||
#include "modules/GUImodules/TestImgui/src/TestImgui.h"
|
||||
|
||||
class ImguiEmbed : public Archimedes::App {
|
||||
|
||||
private:
|
||||
|
||||
void printHelp() {};
|
||||
|
||||
public:
|
||||
ImguiEmbed() {
|
||||
Archimedes::Module* m = (Archimedes::Module*) new TestImgui(nullptr, Get());
|
||||
|
||||
load(m, {});
|
||||
};
|
||||
~ImguiEmbed() {};
|
||||
|
||||
void handleArgs(const int& argc, char* argv[]) {};
|
||||
|
||||
void run();
|
||||
|
||||
//void stopModule(std::list<Archimedes::Module*>::iterator);
|
||||
|
||||
//void startModule(std::string);
|
||||
|
||||
};
|
||||
|
||||
Archimedes::App* MakeApp() { return new ImguiEmbed(); }
|
||||
@@ -18,7 +18,7 @@ void MinimalApp::run() {
|
||||
toClose.clear();
|
||||
|
||||
for(std::string s : toOpen) {
|
||||
load(s, getBlacklist());
|
||||
load(dynamicLoad(s), getBlacklist());
|
||||
}
|
||||
toOpen.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user