remove unnecessary includes

This commit is contained in:
2025-04-10 13:16:54 -05:00
parent 5cf05d7921
commit ab2a101777
4 changed files with 56 additions and 13 deletions

View File

@@ -0,0 +1,54 @@
#include "TestImgui.h"
#include "modules/ImguiModule/src/ImguiModule.h"
TestImgui::TestImgui(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
name = "TestImgui";
ImguiModule* im = new ImguiModule(a, nullptr);
deps[im->getName()] = im;
}
TestImgui::~TestImgui() {
}
void TestImgui::onLoad() {
ImguiModule* im = (ImguiModule*) moduleInstances["ImguiModule"];
if(!im) {
std::cout << "No ImguiModule for TestImgui!\n";
std::abort();
}
ImGui::SetCurrentContext(im->getContext());
}
void TestImgui::run() {
if(demo)
ImGui::ShowDemoWindow(&this->demo);
else
app->end();
{
ImGuiIO& io = ImGui::GetIO();
static float f = 0.0f;
static int counter = 0;
ImGui::Begin("TestImgui Module"); // Create a window called "Hello, world!" and append into it.
ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
counter++;
ImGui::SameLine();
ImGui::Text("counter = %d", counter);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
ImGui::End();
}
}

View File

@@ -1,12 +1,8 @@
#ifndef GUIMODULE
#define GUIMODULE
#endif
#include "Archimedes.h"
#include "utils/Window/Window.h"
class MainGUI : public Archimedes::GuiModule {
class MainGUI : public Archimedes::Module {
public:
MainGUI(Archimedes::App*, void*);
@@ -18,7 +14,7 @@ class MainGUI : public Archimedes::GuiModule {
void run();
};
#ifdef TESTIMGUI_DYNAMIC
#ifdef MAINGUI_DYNAMIC
#define MODULE_TYPE MainGUI
#include "endModule.h"
#endif