mirror of
https://github.com/irskep/BearLibTerminal-Nim
synced 2026-01-02 09:34:39 +00:00
No description
| .vscode | ||
| binaries | ||
| src | ||
| tests | ||
| .gitignore | ||
| BearLibTerminal.h | ||
| bearlibterminal.nimble | ||
| blt_nim.code-workspace | ||
| demo.nim | ||
| LICENSE | ||
| Makefile | ||
| Readme.md | ||
BearLibTerminal-Nim
This is a port of BearLibTerminal to Nim.
Installation
- 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.
Usage
All functions are identical to the C versions, except:
intis aliased toBLIntuint32is aliased toBLColorx, y, w, his passed as a singleBLRectx, yis passed as a singleBLPointw, his passed as a singleBLSize- Return values of
TK_ON/TK_OFFare converted tobool - Functions requiring mutable pointers for multiple return values are wrapped to return appropriate types (
string,BLSize)
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)