I was using docking tree code of IMGui and I created a Application.cpp and Application.h in example_win32_directx9. I am using release and x64 to compile. I have set subsystem in system in Linker to Windows. Code of Application.cpp is:
#include "Application.h"
#include "imgui.h"
namespace MyApp
{
void RenderUI()
{
bool Decimal_places = false;
bool settings = false;
ImGui::Begin("Main");
if (ImGui::Button("Settings")) {
settings = true;
}
else {
settings = false;
}
ImGui::End();
if (settings==true) {
ImGui::Begin("Settings");
if (Decimal_places == false) {
if (ImGui::Button("Off")) {
Decimal_places = true;
}
}
ImGui::End();
}
//static float value = 0.0f;
//ImGui::DragFloat("Value", &value);
}
}
Code of Application.h:
#pragma once
namespace MyApp
{
void RenderUI();
}
It works somewhat fine but I do not how to remove button "off" or change it from "off" to "on" and why do settings window closes. I have already included header file in main.cpp and also using the function of header file in main.cpp.