remove debug prints
This commit is contained in:
@@ -107,36 +107,7 @@ namespace Archimedes {
|
|||||||
|
|
||||||
virtual void startModule(std::variant<std::string, Module*> m) { toOpen.push_back(m); }
|
virtual void startModule(std::variant<std::string, Module*> m) { toOpen.push_back(m); }
|
||||||
|
|
||||||
virtual bool onEvent(const Event& event) {
|
virtual bool onEvent(const Event& event) = 0;
|
||||||
|
|
||||||
unsigned int type = getEventType(event);
|
|
||||||
|
|
||||||
if(type == getEventType(Archimedes::DoLoadModuleEvent())) {
|
|
||||||
|
|
||||||
Archimedes::DoLoadModuleEvent& e = (Archimedes::DoLoadModuleEvent&) event;
|
|
||||||
|
|
||||||
startModule(e.module);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
} else if(type == getEventType(Archimedes::DoUnloadModuleEvent())) {
|
|
||||||
|
|
||||||
Archimedes::DoUnloadModuleEvent& e = (Archimedes::DoUnloadModuleEvent&) event;
|
|
||||||
|
|
||||||
stopModule(e.module);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
} else if(type == getEventType(Archimedes::LoadModuleEvent())) {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else if(type == getEventType(Archimedes::UnloadModuleEvent())) {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void handleEvents() {
|
void handleEvents() {
|
||||||
static bool handled;
|
static bool handled;
|
||||||
@@ -213,8 +184,6 @@ namespace Archimedes {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "1\n";
|
|
||||||
|
|
||||||
void* h = m->getHandle();
|
void* h = m->getHandle();
|
||||||
for(auto it = runOrder.begin(); it != runOrder.end(); it++) {
|
for(auto it = runOrder.begin(); it != runOrder.end(); it++) {
|
||||||
if(*it == static_cast<std::string>(*m)) {
|
if(*it == static_cast<std::string>(*m)) {
|
||||||
@@ -227,13 +196,9 @@ namespace Archimedes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "2\n";
|
|
||||||
|
|
||||||
if(modules.find(*m) == modules.end())
|
if(modules.find(*m) == modules.end())
|
||||||
modules[*m] = m;
|
modules[*m] = m;
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "3\n";
|
|
||||||
|
|
||||||
for(auto it = runOrder.begin(); it != runOrder.end(); it++) {
|
for(auto it = runOrder.begin(); it != runOrder.end(); it++) {
|
||||||
|
|
||||||
if(m->deps.find(*it) != m->deps.end()) {
|
if(m->deps.find(*it) != m->deps.end()) {
|
||||||
@@ -245,8 +210,6 @@ namespace Archimedes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "4\n";
|
|
||||||
|
|
||||||
//insert temporarily to avoid circular dependencies
|
//insert temporarily to avoid circular dependencies
|
||||||
runOrder.insert(roInsert, *m);
|
runOrder.insert(roInsert, *m);
|
||||||
|
|
||||||
@@ -268,21 +231,13 @@ namespace Archimedes {
|
|||||||
m->moduleInstances[it.first] = load(std::get<Module*>(it.second));
|
m->moduleInstances[it.first] = load(std::get<Module*>(it.second));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "5\n";
|
|
||||||
|
|
||||||
//reinsert once final order has been reached
|
//reinsert once final order has been reached
|
||||||
runOrder.remove(*m);
|
runOrder.remove(*m);
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "6\n";
|
|
||||||
|
|
||||||
runOrder.insert(roInsert, *m);
|
runOrder.insert(roInsert, *m);
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "7\n";
|
|
||||||
|
|
||||||
emitEvent(new LoadModuleEvent(*m));
|
emitEvent(new LoadModuleEvent(*m));
|
||||||
|
|
||||||
std::cout << "Load: " << (std::string) *m << "8\n";
|
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,12 +39,8 @@ void ImguiModule::onLoad() {
|
|||||||
std::abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "1\n";
|
|
||||||
|
|
||||||
window = wm->aquireWindow();
|
window = wm->aquireWindow();
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "2\n";
|
|
||||||
|
|
||||||
IMGUI_CHECKVERSION();
|
IMGUI_CHECKVERSION();
|
||||||
context = ImGui::CreateContext();
|
context = ImGui::CreateContext();
|
||||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||||
@@ -61,20 +57,14 @@ void ImguiModule::onLoad() {
|
|||||||
ImGui::StyleColorsDark();
|
ImGui::StyleColorsDark();
|
||||||
//ImGui::StyleColorsLight();
|
//ImGui::StyleColorsLight();
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "3\n";
|
|
||||||
|
|
||||||
// Setup Platform/Renderer backends
|
// Setup Platform/Renderer backends
|
||||||
if(!ImGui_ImplGlfw_InitForOpenGL(window->getWindowImpl().getWindow(), true))
|
if(!ImGui_ImplGlfw_InitForOpenGL(window->getWindowImpl().getWindow(), true))
|
||||||
std::cout << "GLFWImpl failed\n";
|
std::cout << "GLFWImpl failed\n";
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "3.5\n";
|
|
||||||
|
|
||||||
if(!ImGui_ImplOpenGL3_Init("#version 330")) {
|
if(!ImGui_ImplOpenGL3_Init("#version 330")) {
|
||||||
std::cout << "ImGui_ImplOpenGL3_Init failed!\n" << std::endl;
|
std::cout << "ImGui_ImplOpenGL3_Init failed!\n" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "4\n";
|
|
||||||
|
|
||||||
wm->getRenderer()->getCmdList().push_back([](){
|
wm->getRenderer()->getCmdList().push_back([](){
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
|
|
||||||
@@ -85,16 +75,13 @@ void ImguiModule::onLoad() {
|
|||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
});
|
});
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "5\n";
|
|
||||||
rcmd_it = --wm->getRenderer()->getCmdList().end()++;
|
rcmd_it = --wm->getRenderer()->getCmdList().end()++;
|
||||||
|
|
||||||
std::cout << "onLoad: " << name << "6\n";
|
|
||||||
//Compute first frame ahead of first WindowModule->run()
|
//Compute first frame ahead of first WindowModule->run()
|
||||||
ImGui_ImplOpenGL3_NewFrame();
|
ImGui_ImplOpenGL3_NewFrame();
|
||||||
ImGui_ImplGlfw_NewFrame();
|
ImGui_ImplGlfw_NewFrame();
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
|
||||||
std::cout << "ImguiModule loaded\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImguiModule::onEvent(const Archimedes::Event &event) {
|
bool ImguiModule::onEvent(const Archimedes::Event &event) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class WindowModule : public Archimedes::Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
windowRefs++;
|
windowRefs++;
|
||||||
|
window->getWindowImpl().restoreContext();
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +61,8 @@ class WindowModule : public Archimedes::Module {
|
|||||||
|
|
||||||
int windowRefs = 0;
|
int windowRefs = 0;
|
||||||
|
|
||||||
Archimedes::Window* window;
|
Archimedes::Window* window = nullptr;
|
||||||
Archimedes::Renderer* renderer;
|
Archimedes::Renderer* renderer = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user