jawa0 / aish3

AI LLM Agent with memories
Apache License 2.0
3 stars 1 forks source link

Don't redraw all text every frame, one char at a time #1

Closed jawa0 closed 1 year ago

jawa0 commented 1 year ago

Currently all text is rendered char by char, with a surface and texture created for each character. This was easy to get running, and makes selection / text background colour easier, but it is very likely terrible for performance. I'm noticing the app is sluggish on my personal laptop. Look into this. Easy improvement: if a TextArea doesn't have focus, and the text isn't changing then just cache all text to one surface, instead of redrawing char by char.

jawa0 commented 1 year ago

All drawn chars are cached to a texture, unless the text, selection, or scrolling changes.