diff options
Diffstat (limited to '')
| -rw-r--r-- | termbox2/README | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/termbox2/README b/termbox2/README new file mode 100644 index 0000000..e28c58c --- /dev/null +++ b/termbox2/README | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | This module provides bindings for termbox2. | ||
| 2 | |||
| 3 | Some changes to the API have been made to enable using this library in a | ||
| 4 | more Hare-idiomatic style. In particular: | ||
| 5 | - The tb_ and TB_ prefixes have been removed, as the namespace termbox2:: | ||
| 6 | is used instead. We recommend importing this library as tb, so that one | ||
| 7 | can write e.g. tb::init(), keeping it similar to the original tb_init(). | ||
| 8 | - Functions return a value that can be either a valid result (e.g. int, | ||
| 9 | void, str...) or an int-backed error [[termbox2::err]]. The error codes | ||
| 10 | are consistent with the original library and can be interpreted with | ||
| 11 | [[termbox2::strerror]]. Some additional codes for binding-related errors | ||
| 12 | are provided. | ||
| 13 | - Similarly to the previous point, some functions that use to return | ||
| 14 | multiple values by taking pointer parameters now simply return a tuple, | ||
| 15 | see for example [[termbox2::get_fds]]. | ||
| 16 | - The tb_event type has changed into a tagged union of 3 types, | ||
| 17 | see [[termbox2::event]]. | ||
| 18 | - The four tb_print* functions have been replaced by a single | ||
| 19 | [[termbox2::print]] function that uses Hare-style string formatting. | ||
| 20 | Similarly, tb_send and tb_sendf have replaced by only one function | ||
| 21 | [[termbox2::send]]. | ||
| 22 | - The constants provided by ther termbox2 API, such as those for key codes, | ||
| 23 | colors and attributes, have been split into various structures, such as | ||
| 24 | [[termbox2::KEY]], [[termbox2::COLOR]] and [[termbox2::ATTRIBUTE]]. | ||
| 25 | |||
| 26 | Some functionality has been outright removed. If you are interested in | ||
| 27 | having any of the following available in these bindings, don't hesitate | ||
| 28 | to send a patch or a feature request to sebastiano@tronto.net: | ||
| 29 | - The tb_get_cell function is not available. This function makes it | ||
| 30 | possible to navigate through cells via pointer arithmetic, but since | ||
| 31 | the Hare [[termbox2::cell]] type does not have the same size as the | ||
| 32 | original tb_cell, this would not translate cleanly. | ||
| 33 | - The tb_iswprint, tb_wcwidth and tb_utf8_* have functions have been | ||
| 34 | removed. Use the Hare standard libary functions [[encoding::utf8::]] | ||
| 35 | and [[strings::]] instead. | ||
| 36 | - The tb_last_errno function has been removed. | ||
| 37 | - The TB_CAP_* code constants have been removed. | ||
| 38 | |||
| 39 | Links: | ||
| 40 | - Main repository: https://git.tronto.net/hare-termbox2 | ||
| 41 | - termbox2: https://github.com/termbox/termbox2 | ||
