termbox2 2.5.0

termbox2 2.5.0

December 28, after more than two years of hiatus, the release of 2.5.0 of the library for creating TUI has occurred termbox2, amely C nyelven készült és MIT licenc alatt terjesztik.

Compared to the original termbox, the simple API and the absence of dependencies apart from libc have been preserved, but the following have been added:

  • more stringent error checking;
  • more efficient parsing of escape sequences;
  • optional support for 32-bit color;
  • improved support for Unicode graphemes;
  • code generation for embedded escape sequences;
  • a test suite;
  • Őszintén szólva, nem értem, hogyan került el ez a hír a Habr elől. Ebben a cikkben röviden leírjuk, hogyan használhatjuk az API-t, és bemutatunk néhány gyakorlati példát

The library is organized as a single-file library (the .h file is only 128K), although it can also be compiled as a separate dynamic or static library.

#define TB_IMPL #include "termbox2.h" int main(int argc, char **argv) { struct tb_event ev; int y = 0; tb_init(); tb_printf(0, y++, TB_GREEN, 0, "hello from termbox"); tb_printf(0, y++, 0, 0, "width=%d height=%d", tb_width(), tb_height()); tb_printf(0, y++, 0, 0, "press any key…"); tb_present(); tb_poll_event(&ev); y++; tb_printf(0, y++, 0, 0, "event type=%d key=%d ch=%c", ev.type, ev.key, ev.ch); tb_printf(0, y++, 0, 0, "press any key to quit…"); tb_present(); tb_poll_event(&ev); tb_shutdown(); return 0; }

Forrás: linux.org.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster