Hacker News new | ask | show | jobs
by rtpg 2618 days ago
I think that React is like 90% of the way there and you would just need to mess around with the VDOM a bit for this.

To be honest, given that web render output is a tree instead of flat "render to screen" stuff, writing a nice immediate mode GUI is not obvious.

If you're... very clever you could take React and the State stuff, at least conceptually, and get what you want here.

1 comments

wouldn't you need some sort of gpu access to have a smooth UI rendering with immediate gui(in production)?
This is if you expect to build an immediate mode with the same flat rendering model.

imgui's model is "you draw onto pixels". You could create another mental model which is "you draw onto a tree." so instead of saying "drawText(x, y, text)" you would do something like "drawText(domLocation, text)"

Granted, this model gets a bit messier, and _some_ might say defeats the purpose of immediate mode. But I think you could still get conciseness benefits on this.