This is a minimal, C++ cross-platform library for writing real-time games that run in a terminal in text mode.
- Windows 11 terminal, macOS Tahoe Terminal, macOS iTerm2, Linux xterm
- 24-bit (RBA8) color for foreground and background
- Keyboard input
- Mouse input
- Clipping region stack
- Blitting with transparency
- Double buffered (no flicker)
- String printing with word wrap
- Number formatting to string
- Full Unicode support using char32_t characters and strings
- Struct and function C-like API, with C++ strings and destructors for memory management
- No dependencies--uses only standard built-in platform libraries
main.cpp
: Demo program
textgame.h
: Cross-platform header and entry point documentation.
Defines Vector2i, Color3, String, Character,
Image, overloaded operators, and helper functions.
textgame.cpp
: Cross-platform library implementation
MIT License
Some other small, cross-platform libraries useful for making terminal-mode games:
- Crossline: readline()
- ffaudio: wave audio input and output
- Gainput: gamepad input
- GameNetworkingSockets: networking
- Recast Navigation: 3D pathfinding and CPU voxelization
- Box2D: 2D physics