Skip to content

Commit cc4dde2

Browse files
committed
Add notes about API mapping
1 parent f3fc173 commit cc4dde2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

examples/termbox/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,46 @@ And the example `termboxtest.py` which is copied verbatim from:
1414

1515
https://github.com/nsf/termbox/blob/b20c0a11/test_termboxmodule.py
1616

17+
18+
### API Mapping Notes
19+
20+
Notes taken while mapping the Termbox class:
21+
22+
tb_init() // initialization console = tdl.init(132, 60)
23+
tb_shutdown() // shutdown
24+
25+
tb_width() // width of the terminal screen console.width
26+
tb_height() // height of the terminal screen console.height
27+
28+
tb_clear() // clear buffer console.clear()
29+
tb_present() // sync internal buffer with terminal tdl.flush()
30+
31+
tb_put_cell()
32+
tb_change_cell() console.draw_char(x, y, ch, fg, bg)
33+
tb_blit() // drawing functions
34+
35+
tb_select_input_mode() // change input mode
36+
tb_peek_event() // peek a keyboard event
37+
tb_poll_event() // wait for a keyboard event * tdl.event.get()
38+
39+
40+
* - means the translation is not direct
41+
42+
43+
44+
init...
45+
tdl doesn't allow to resize window (or rather libtcod)
46+
tb works in existing terminal window and queries it rather than making own
47+
48+
colors...
49+
tdl uses RGB values
50+
tb uses it own constants
51+
52+
event...
53+
tb returns event one by one
54+
tdl return an event iterator
55+
56+
57+
tb Event tdl Event
58+
.type .type
59+
EVENT_KEY KEYDOWN

0 commit comments

Comments
 (0)