This is a port of BearLibTerminal to Nim.
- Download the shared library binary from the BearLibTerminal web site.
nimble install bearlibterminal
- Make sure the shared library is somewhere it can be found. For development, this would typically be the working directory of your program when it runs.
All functions are identical to the C versions, except:
intis aliased to
uint32is aliased to
x, y, w, his passed as a single
x, yis passed as a single
w, his passed as a single
- Return values of
TK_OFFare converted to
- Functions requiring mutable pointers for multiple return values are wrapped to return appropriate types (
The library also includes some bonus functions to save you some unsafe bit casts:
proc terminalGetCurrentLayer*(): BLInt = terminalState(TK_LAYER) proc terminalGetCurrentColor*(): BLColor = cast[BLColor](terminalState(TK_COLOR)) proc terminalGetCurrentBackgroundColor*(): BLColor = cast[BLColor](terminalState(TK_BKCOLOR)) proc terminalGetIsCompositionEnabled*(): bool = terminalCheck(TK_COMPOSITION)