2D & 3D graphics engine in the terminal [C/C++]
TermGL
A terminal-based graphics library for 2D and 3D graphics.
Features:
- Windows & *NIX support
- C99 compliant without external dependencies
- Custom vertex and pixel shaders
- Affine texture mapping
- 24 bit RGB mode
- Indexed color mode: 16 Background colors, 16 foreground colors, bold and underline
- Non-blocking input from terminal
- Mouse tracking
Gallery



Documentation
A tutorial can be found here. Additionally, please reference the demo, and read the function documentation in termgl.h for more details.
Build
You can compile termgl.c as you would any other C source file. You can also compile it as a shared library libtermgl.so by calling make shared. To install the shared library, sudo make install.
To enable 3D functionality, define TERMGL3D or use the -DTERMGL3D compiler flag. To enable utility functions, define TERMGLUTIL or use the -DTERMGLUTIL compiler flag. To disable helper functions for vector math and shaders, define TERMGLMINIMAL or use the -DTERMGLMINIMAL compiler flag.
To use TermGL in C++, compile it as a shared library and link against the libtermgl.so file. The termgl.h header can be included from C++ files.
To compile a demo program, run make demo, creating the termgl_demo binary.
Demo
A demo program can be found at termgl_demo.c.
Available demos and TermGL features used:
- Utah Teapot\
- Color Palette\
- Mandelbrot\
- Realtime Keyboard\
- Textured Cube\
- RGB\
- Mouse\