|
|
|
|
|
by shrimpx
1956 days ago
|
|
> When you call ImGui::Button("Hello World") it has no way of telling if it’s the same button as on the previous frame, or a new one. Can you solve this by adding stable IDs to the API, so you'd call `ImGui::Button("my-button-id", button_text)`? |
|
Who and when should destroy backend visual nodes? If you won’t use an ID in some frame, does it indicate the backend should drop the related state? What if an animation is still playing on the element in question? What if the missing control re-appears later i.e. was only hidden temporarily? What should backend do if you reuse same ID for different things?
One can implement simple stuff using any approach, immediate GUI is often the simplest of them. It’s when use cases are complicated you need a full-blown retrained mode OO framework. Win32, HTML DOM, MS XAML, QT, UIKit are all implemented that way, that’s not a coincidence.