nxt::ui::TerminalCompositor class

Double-buffered terminal compositor with HUD/scroll region support.

Constructors, destructors, conversion operators

TerminalCompositor(nxt::Size size, GlyphTable& glyphs)
Create double buffers for a terminal of size.

Public functions

auto back_buffer() →  Raster& noexcept
Mutable buffer rendered by the next frame.
auto glyphs() const →  GlyphTable& noexcept
Shared glyph table used by both buffers.
auto hud_height() const →  height_t noexcept
Current HUD height.
void present_frame()
Present changed back-buffer cells to stdout.
void present_frame(std::ostream& out)
Present changed back-buffer cells to an output stream.
void resize(nxt::Size size)
Resize both front and back buffers and terminal bookkeeping.
void set_hud_height(height_t hud_height, height_t term_height)
void set_hud_height(height_t hud_height, height_t term_height, std::ostream& out)
auto size() const →  nxt::Size noexcept
Current compositor size.

Function documentation

void nxt::ui::TerminalCompositor::set_hud_height(height_t hud_height, height_t term_height)

Set HUD height. In HUD mode, the scroll region ends immediately above the HUD. If the HUD fills the terminal, the compositor uses full-screen mode.