Add Delay For ImGui #6847
sFIsAnExpert
started this conversation in
Build/Link/Run/Fonts issues ONLY!
Replies: 1 comment 1 reply
-
ImGui is an immediate mode API. By design, everything is immediate, and there would be no delaying possible within the API itself. What you could be doing is hold on to an external delay mechanism yourself, similar to the API you're describing. Something along the lines of: if (ImGui::Button("Some button")) {
m_deadline = std::chrono::steady_clock::now() + 5ms;
}
if (std::chrono::steady_clock::now() >= m_deadline) {
m_deadline = std::chrono::steady_clock::now() + 5ms;
// do whatever
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the proper way of adding a delay in ImGui?
Say for instance in my ImGui Window I want a delay similar to WinAPI Sleep() Function.
I want to output text to ImGui Window but only after the delay of 5 seconds is over, for instance -
I have implemented something similar to this which is compatible with ImGui but I am just wondering why is there not one currently and will we have it in the future?
Beta Was this translation helpful? Give feedback.
All reactions