clay/examples/termbox2-demo
2025-06-24 17:44:53 +00:00
..
resources Add example for termbox2 renderer 2025-05-25 15:38:23 +00:00
CMakeLists.txt Add example for termbox2 renderer 2025-05-25 15:38:23 +00:00
main.c Clean up example code 2025-06-24 17:44:53 +00:00
readme.md Add example for termbox2 renderer 2025-05-25 15:38:23 +00:00

Termbox2 renderer demo

Terminal-based renderer using termbox2

This demo shows a color palette and a few different components. It allows changing configuration settings for colors, border size rounding mode, characters used for borders, and transparency.

Keybinds:
c/C - Cycle through color modes
b/B - Cycle through border modes
h/H - Cycle through border characters
t/T - Toggle transparency
d/D - Toggle debug mode
q/Q - Quit

Configuration can be also be overriden by environment variables:

  • CLAY_TB_COLOR_MODE
    • NORMAL
    • 256
    • 216
    • GRAYSCALE
    • TRUECOLOR
    • NOCOLOR
  • CLAY_TB_BORDER_CHARS
    • DEFAULT
    • ASCII
    • UNICODE
    • NONE
  • CLAY_TB_TRANSPARENCY
    • 1
    • 0
  • CLAY_TB_CELL_PIXELS
    • widthxheight

Building

Build the binary with cmake

mkdir build
cd build
cmake ..
make

Then run the executable:

./clay_examples_termbox2_demo

Attributions

Resources used: