Will egui implement caching?

I saw this discussion but I am not too sure if they are actually going to implement caching capabilities or not?

Furthur more if this was implemented would it be as suitable to make a gui application which uses very static animations as though it is retained graphics?

I can't speak for egui as I don't have much experience with it, but I have used Dear ImGui extensively via the imgui-rs bindings (which I help maintain)

I think it kind of "depends" on your exact application design. If I understand right the idea in the linked discussion is to cheaply know "if mouse moves in area X, then we need to redraw". For an appliation you probably don't need this - your application will occupy the whole window anyway (unlike in game where a debug tool probably only covers a small part of the main ~GL surface). E.g if using winit, it's mostly just a case of using ControlFlow::Wait instead of Poll

For specific, very static applications this can work perfectly - no redraws until user does "something". Things become more complicated when you have any animations, even things like a blinking text cursor..

The most interesting "simple" approach I've seen to this is this PR for Dear ImGui:

Basically it dynamically alters the frame rate of the application based on what is visible - e.g a window can declare it never changes unless there is user input (mouse clicks etc), another can declare it needs to update an animation at 5fps, and so on - then it works out how often the whole application needs to update

I suspect applying the same approach to egui would probably be pretty straight forward (but it probably solves a slightly different problem to the originally linked discussion)


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.