39 lines
800 B
C++
39 lines
800 B
C++
#include "MinimalApp.h"
|
|
|
|
void MinimalApp::run() {
|
|
|
|
for(std::string m : runOrder) {
|
|
modules[m]->onLoad();
|
|
}
|
|
|
|
// Main loop
|
|
while (!done && !runOrder.empty()) {
|
|
|
|
for(std::string m : runOrder) {
|
|
modules[m]->run();
|
|
}
|
|
|
|
handleEvents();
|
|
|
|
for(std::string m : toClose) {
|
|
unload(m);
|
|
}
|
|
toClose.clear();
|
|
|
|
for(auto m : toOpen) {
|
|
static Archimedes::Module* n;
|
|
if(std::holds_alternative<std::string>(m)) {
|
|
n = load(std::get<std::string>(m));
|
|
} else {
|
|
n = load(std::get<Archimedes::Module*>(m));
|
|
}
|
|
if(n) {
|
|
n->onLoad();
|
|
n = nullptr;
|
|
}
|
|
}
|
|
toOpen.clear();
|
|
}
|
|
|
|
}
|