- Notifications
You must be signed in to change notification settings - Fork5
A library that creates a terminal-like window with feature-packed drawing of text and easy input handling. MIRROR.
License
tommyettinger/BearLibTerminal
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
BearLibTerminal provides a pseudoterminal window with a grid of character cells and a simple yet powerful API for flexible textual output and uncomplicated input processing.
- Unicode support: you can use UTF-8 or UTF-16/32 wide strings easily.
- Support for bitmap and vector (TrueType) fonts and tilesets.
- Extended output facilities: tile composition, alignment, offsets.
- High performance (uses OpenGL).
- Keyboard and mouse support.
- Bindings for several programming languages: С/С++, C#, Go, Lua, Pascal, Python, Ruby.
- Windows, Linux and OS X support.
- Reference (functions, constants, behaviour)
- Design overview
Some notes about using it with various languages or compilers:
Visual C++ projects should be linked against BearLibTerminal.lib import library (specify it in the additional linker dependencies).
MinGW projects should link against .dll directly (the .lib is just an import library for Visual C++, do not copy it):
g++ -I/path/to/header -L/path/to/dll main.cpp -lBearLibTerminal -o app.exe
Python packages are available. You can install everything you need to use the library with
pip install bearlibterminal
Depending on the OS and Python installation, you might also want to
- Replace
pip
withpip3
orpython3 -m pip
to select a correct version of Python. - Add
--user
flag to install package locally (i. e. user-wide).
Package contains both wrapper and an appropriate binary for the platform, so you do not need to copy anything else anywhere. Just import the library in the source:
from bearlibterminal import terminalterminal.open()terminal.printf(2, 1, "Hello, world!")terminal.refresh()while terminal.read() != terminal.TK_CLOSE: passterminal.close()
Wrapper for Lua is built-in. You need to use a regular (dynamic) Lua runtime and place BearLibTerminal binaryin a suitable location (e. g. in the same directory as script). For Linux you'll also need to rename the .soto just 'BearLibTerminal.so' (dropping the 'lib' prefix). After that it would be possible to import the librarythe usual way:
local terminal = require "BearLibTerminal"
BearLibTerminal is a language-agnostic dynamic-link library (.dll/.so/.dylib), therefore you generally do not haveto build it yourself and may simply use theprebuilt binaries.
To build BearLibTerminal you will need CMake and a recent GCC/MinGW compiler. For Linux any GCC version 4.6.3 and abovewill do. For Windows there are several MinGW builds with various quirks, usingTDM-GCC ormingw-builds (a flavour of mingw-w64) is recommended.MinGW compiler MUST use Posix thread model.
The library is licensed mainly under the MIT license with a few parts under other permissive licenses.
About
A library that creates a terminal-like window with feature-packed drawing of text and easy input handling. MIRROR.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.