work on layers

This commit is contained in:
2025-04-09 10:52:23 -05:00
parent 3a797fb19a
commit 42b5a53b89
8 changed files with 102 additions and 63 deletions

View File

@@ -12,9 +12,7 @@ TestImgui::TestImgui(void* h, Archimedes::App* a) : Archimedes::GuiModule(h, a)
}
TestImgui::~TestImgui() {
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
void TestImgui::onLoad() {
@@ -86,9 +84,7 @@ void TestImgui::TILayer::onAttach() {
//ImGui::StyleColorsLight();
// Setup Platform/Renderer backends
GLFWwindow* w = wm->getWindow()->getWindowImpl().getWindow();
if(!ImGui_ImplGlfw_InitForOpenGL(w, true))
if(!ImGui_ImplGlfw_InitForOpenGL(wm->getWindow()->getWindowImpl().getWindow(), true))
std::cout << "GLFWImpl failed\n";
if(!ImGui_ImplOpenGL3_Init("#version 330")) {
std::cout << "ImGui_ImplOpenGL3_Init failed!\n" << std::endl;
@@ -107,6 +103,9 @@ void TestImgui::TILayer::onRender() {
}
void TestImgui::TILayer::onDetach() {
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
bool TestImgui::TILayer::onEvent(const Archimedes::Event&) { return false; }