InDieTasten / ASCII-mate

A CLI tool with mouse support for drawing ascii art and animations
MIT License
1 stars 1 forks source link

Add virtual screen and diff rendering #3

Open InDieTasten opened 3 weeks ago

InDieTasten commented 3 weeks ago

This will be required for reducing flickering on larger terminals that continuously render updates inbetween our manual flushes. Instead of clearing the screen and rerendering everything on the terminal, we keep a snapshot of the previously rendered frame in Lua memory, render the new frame, then perform a diff between the frames to determine the least amount of operations to go from the previous frame to the new frame. This way, unchanged "tiles" in the terminal will not need to be redrawn and will not flicker.