|
|
|
|
|
by munificent
1420 days ago
|
|
> My initial attempt was based on placing character images, one-by-one, onto a canvas element, but it was horribly sluggish. I've done web-based terminal-style renders in a number of different ways for my roguelike [1]. I've done both DOM and canvas renderers. I found that the fastest approach to be: 1. Render each glyph to a canvas. 2. Only re-render glyphs that actually changed. Doing that was much faster than using the DOM. I imagine I could go even faster using WebGL but at this point, I considered the performance good enough. For anyone interested, my terminal library is written in Dart and is open source: https://github.com/munificent/malison [1]: http://munificent.github.io/hauberk/ |
|
But of course, the idea of developing a terminal using a standard DOM-centric approach is usually not going to turn out very well... though Google is an exception here with the hterm js library that underlies the terminal output for Chromebooks: https://chromium.googlesource.com/apps/libapps/+/master/hter.... Most Chromebook users will never have the opportunity to put this to use, though people like me who put their Chromebooks in developer mode the first chance they get use it all the time.