Rendering order needs rework
w23 opened this issue · comments
Currently simple renderer forces full screen text rendering when with_api
returns. However, display.rs
calls with_api
many times for various things like message overlays, etc. This makes it render text more than once and actively interferes with rects rendering (they get overwritten).
For example the sequence could be:
- Clear with background color
- Fill internal render buffers with actual terminal text data. Don't render anything yet.
- Add "overlay" text to render buffers: messages, debug timers, etc. Don't add any background color rects, do this with text background color property instead.
- Paint entire screen with basic text. This will paint both content and messages
- Draw rects that do undreline/strike. Don't draw any message background rects at all.
- Swap buffers
Alternatively, text rendering could be organized as "Draw this text into this quad", so that we could draw different parts of screen with different rects in any order we want:
- one text-renderer instance for main content
- second is for messages and stuff