Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Why can't we draw some text and a box 60 times a second so my window doesn't skip when I scroll?

Battery, for starters. If desktop UIs were all written like games, nobody would carry their laptops anywhere. Because they all be plugged in at home.



What do you think your screen is doing all the time? You can't blit to the screen once and then "freeze" it. Your computer/phone is blitting pixels all the time.


Most games are immediate mode graphics. An operating system cannot function efficiently if its graphics are not more like a retained mode system. There’s a big difference between the two.


The point of the GP argument is that the lack of decent cross-platform GUI libraries is astounding to game programmers because games are much more difficult and involved than GUIs yet producing a game that runs on multiple platforms is mostly a solved problem.

The point is not to say "Why don't you guys do GUIs like games where you recompute the whole thing every frame?". Even the people who talk about immediate mode GUI are talking about the API of defining the UI, not the implementation details. It's perfectly consistent to have a GUI library that exposes an immediate mode API but retains a lot of state between frames and only does repainting when necessary.

Also I find this talk about battery life in general disingenious given that more and more tech companies are converging on implementing applications in Electron which drains battery life very quickly.


There was a post on HN where someone explored the immediate gui paradigm for their PhD (or masters degree, don't remember) and they discovered that this assumption is actually incorrect, given the interactions and os optimizations the battery usage (well, cpu usage and gpu usage) was lower overall. I remember very little details, it was amazing


I would have to read it to see what you mean. I cannot imagine a world in which the normal way of doing immediate mode graphics was more efficient than retained mode.


I'm trying hard to find the link, but I'm struggling, sorry.

During my researching, a lot of posts point out that "innediate mode" refers to the API, not the implementation, and that React is effectively a hack to obtain an immediate mode gui on top of retained mode.

Doesn't say anything about performance, just that the implementation behind the scene can retain state to save battery




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: