-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Going cpu idle / Redisplay when using glfwWaitEvents() in main loop? #1206
Comments
Always update for 1-2 extra frames after mouse is moved and it should be ok. |
To clarify, several types of actions incur a frame of delay. For example when you open a popup, the first frame is used for a dry run to compute an initial size for the popup. Ideally, imgui should expose a flag/timer to express that sort of thing optimally and reliably, and also allow you to e.g. refresh on a cursor blink if you desire so (probably unlikely). |
Thanks for the answer, I see your point. I'll to modify my main loop accordingly, even though it gets a bit more cumbersome to do so. |
@jdumas Let me know if this is working out for now, and if the issue can be closed! Thanks. |
@ocornut Sure. Right now I'm refreshing the display constantly to make the UI is responsive. Would still be nice to have |
Why not just doing this in the meanwhile?
It should be a matter of just adding a counter on your side and resetting it on any input event. |
I just didn't get around to do that yet, since I have something that works already :p. |
Hi there,
I have a question about using ImGui + Glfw when the application is not permanently refreshed, i.e. when there is a
glfwWaitEvents()
in the main loop. Let's say we take theopengl3_example
app, and add aglfwWaitEvents();
after L89.Now, if you launch the app, the FPS is only updated when you move the mouse, which makes sense. However, if I click on the color picker (to switch between RGB/HSV/Hex), but don't move the move, then things are updated only when I move the mouse again.
I was wondering if it was a limitation of ImGui's immediate mode, a problem in the ColorEdit widget, or something more general that should be done in the glfw main loop of this example?
The text was updated successfully, but these errors were encountered: