Do I need to force GUI rendering when data change


#1

Hello,

I’m implementing a light GUI architecture for my application. So mostly I created Dialog classes, with a Display function in each calling ImGui:: functions. In the main loop I just call Display from all my Dialogs objects.

So dialogs, on user event, call their corresponding “controllers” (I’m not making a MVC architecture), who update the model. The model can also be updated independently from the GUI, so in this case the GUI has to be rendered to display new values.

What would be the ImGui way of doing that? Just wait for the main render loop (i’m using event polling) to loop again? Or maybe with this way I may have some “lag” and I should consider a way to force the rendering of the new values?

If necessary to know, I’m using Glfw+gl3w.

Thank you.


#2

Hello,
I don’t understand the question very well, there are too many ambiguous points in it.
The typical way of using dear imgui is to refresh the UI e.g. 60 times a second.


#3

Thank you for you answer.

In a simple way, my question was: In the ImGui philosophy, if I have a text field in the GUI, and the value of this text field has been modified by some code in the application, do I just wait for the next rendering loop to reflect the new value of this text field, or should I call something to force the new rendering loop to occur.

Thank you.


#4

You just wait for the next rendering loop to refresh everything.