static bool error_auth = false;
if ( ImGui::InputText("username", ...) )
error_auth = false;
if ( ImGui::InputText("password", ...) )
error_auth = false;
if ( ImGui::Button("Login") )
{
if ( strcmp(username, "admin") == 0 && strcmp(password, "admin") == 0 )
{
// next window after successful auth
}
else
{
error_auth = true;
}
}
if ( error_auth )
ImGui::TextColored(ImColor(220, 20, 25).Value, "Wrong username/password");