4 ms·
In my opinion, the reason why immediate-mode API are so efficient and practical is because it helps to avoid structure duplication. An UI, from an abstract poi
by stephc_int13 6y ago
In my opinion, the reason why immediate-mode API are so efficient and practical is because it helps to avoid structure duplication.
An UI, from an abstract point of view, is nothing but a big structure.
When you're writing an application or a game, you very often already have an existing structure containing everything you need.
Take a simple example : a leaderboard.
Using anything but an immediate-mode API will force you to create a second, complex structure to hold this leaderboard, and a lot of glue code to copy data to and from this structure.
- boulos 6y agoInteresting. I think that argument is “people can’t usefully agree on common abstractions, why bother forcing a translation”. And so for users of scene graphs, it’s basically “well, we can all agree there’s a basic graph and bounding boxes are a thing” so you’re not giving up much. But for UI, is the argument that it’s often more like drawing/painting, so you spend more cycles (in both mental and processing senses) on trying to express the thing you already knew you wanted to achieve?