I'm using this Dear ImGui code in a function called several times per frame, resulting in duplications of the called UI element.
ImGui::Begin("Hello World"); ImGui::SliderFloat("test", &foo, 0.0f, 100.0f); ImGui::End(); Result:
How to correct this behaviour? Can Dear ImGui be set to avoid this, or do I have to take care of this myself?

if( not flag ) { /* draw your thing */ flag = true; }and reset theflagevery frame? \$\endgroup\$I'm using this Dear ImGui code in a function called several times per frame. Why is this function called several times per frame? \$\endgroup\$