News for hackers. Stuff that matters.
Re:Immediate Mode GUI Programming by danpla on Tuesday January 16, 2024 @12:56PM (#39016376)
> 'Immediate mode UI' is only an API design philosophy, it says nothing about what happens under the hood.

Well, if you have a traditional immediate mode API like:

    if (button("Start"))
        start();
Then it's not just about the API philosophy: at the very least, it ties the event handling to the drawing.
Re:Immediate Mode GUI Programming by flohofwoe on Tuesday January 16, 2024 @05:59PM (#39020373)
Which kinda makes sense, because a non-existing button usually isn't clickable, and also wouldn't be able to emit events in an event-driven API ;)

Btw, the drawing doesn't happen in the button function, it just tells the UI system that there exists a button with the label "Start" in the current frame. The rendering usually happens much later after the UI system has collected the entire UI description for the frame, otherwise rendering would be very inefficient.