mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-08 19:02:56 +00:00
Going cpu idle / Redisplay when using glfwWaitEvents() in main loop? #1206
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#1206
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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_exampleapp, 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?
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
bool ImGui::NeedRedraw()callback or something.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.
Feel free to close the issue if you like, and I'll reopen it if I have further questions =)