top | item 39842937

(no title)

tayistay | 1 year ago

Under disadvantages:

> You can also call the layout code twice (once to get the size, once to do the interaction), but that is not only more expensive, it's also complex to implement, and in some cases twice is not enough. egui never does this.

I've found multi-pass imgui to work totally fine, and I use it for one of my apps [1]. I can support (nested) hstack and vstack layouts which IIRC egui can't. There is added expense of calling the "draw" code again, but it's negligible in my profiles (doing the actual layout calculations is more expensive, so I only invalidate the cached layout when the data model changes). It wasn't particularly complex to implement: each ui function simply does different things if you are doing a layout pass vs a draw pass.

[1] https://audulus.com

discuss

order

No comments yet.