Building
The driver is selected automatically based on the platform:
| Driver | Windows | Linux | macOS | Sources |
|---|---|---|---|---|
| gtansi | ✅ | ✅ | ✅ | src/*.c + src/gtansi/*.c |
| gtglfw | ✅ | ✅ | ✅ | src/*.c + src/gtglfw/*.c |
| gtsdl3 | ✅ | ✅ | ✅ | src/*.c + src/gtsdl3/*.c |
| gtwvt | ✅ | src/*.c + src/gtwvt/*.c | ||
| gtxwc | ✅ | ✅ | src/*.c + src/gtxwc/*.c |
Without GT the Makefile takes gtwvt on Windows and gtxwc on Linux and macOS:
make
make install
make -C example
make -C testsTo select a driver, pass it to make; the programs of example and tests need the same driver as the library:
make GT=gtglfw
make GT=gtglfw install
make -C example GT=gtglfw
make -C tests GT=gtglfwAn example of building on Linux:
make GT=gtansi
make install GT=gtansi PREFIX="$HOME/.local"
make -C example GT=gtansi
make -C tests GT=gtansiThe gtansi driver shows the screen in the terminal the program runs in, with escape sequences, without another library: the console of Windows 10 and later (also Windows Terminal), any terminal on Linux and macOS, also over SSH. Its programs are console programs.
The program draws on the normal screen of the terminal, as in xBase: what it wrote stays after it ends. GtSetAltScreen( T ) draws on the alternate screen; the screen of the shell then comes back at the end.
Colors are exact RGB on Windows and with COLORTERM=truecolor, else the nearest of 256 colors (TERM with 256color) or of 16.
Keys with Shift, Ctrl and Alt, the mouse, the wheel, pasting, a new size of the terminal, GtSetTitle() and the clipboard work; on Linux and macOS the clipboard is set through the terminal (OSC 52). The G functions draw nothing: a terminal has no pixels.