I am making a program using ImGui and I want to display a PopUp if the input on one window is bad after clicking the button "OK". It enter the IF statement and execute the code but the popup doesnt show up.
ImGui::OpenPopup("Error Creating Image");
// Always center this window when appearing
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::BeginPopupModal("Error Creating Image", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::SetItemDefaultFocus();
ImGui::Text("The size of the Image must be greater than 0. Also it need to have a name!\n\n");
ImGui::Separator();
if (ImGui::Button("OK")) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}