This commit is contained in:
2025-03-22 01:45:25 -05:00
parent 8e81cd81dc
commit 4bd2d6908e
8 changed files with 46 additions and 27 deletions

View File

@@ -7,21 +7,8 @@
#include <GLFW/glfw3.h>
TestImgui::TestImgui(void* h, Archimedes::App& a) : Archimedes::GuiModule(h, a) {
name = "TestImgui";
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
// Setup Dear ImGui style
ImGui::StyleColorsDark();
//ImGui::StyleColorsLight();
// Setup Platform/Renderer backends
ImGui_ImplGlfw_InitForOpenGL(getWindow()->getWindowImpl().getWindow(), true);
ImGui_ImplOpenGL3_Init("#version 130");
}
TestImgui::~TestImgui() {
@@ -30,7 +17,32 @@ TestImgui::~TestImgui() {
ImGui::DestroyContext();
}
void TestImgui::onLoad() {}
void TestImgui::onLoad() {
createWindow();
std::cout << "Check version" << std::endl;
IMGUI_CHECKVERSION();
std::cout << "CreateContext" << std::endl;
ImGui::CreateContext();
std::cout << "GetIO" << std::endl;
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
std::cout << "Set Style" << std::endl;
// Setup Dear ImGui style
ImGui::StyleColorsDark();
//ImGui::StyleColorsLight();
std::cout << "ImGui_ImplGlfw_InitForOpenGL" << std::endl;
// Setup Platform/Renderer backends
ImGui_ImplGlfw_InitForOpenGL(window->getWindowImpl().getWindow(), true);
std::cout << "ImGui_ImplOpenGL3_Init" << std::endl;
ImGui_ImplOpenGL3_Init("#version 130");
std::cout << "Successful onLoad" << std::endl;
}
void TestImgui::run() {
@@ -42,7 +54,7 @@ void TestImgui::run() {
ImGui::Render();
getWindow()->getRenderer().addRenderCmd([](){
window->getRenderer().addRenderCmd([](){
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
});