csboo / cpptui

tui lib c++ :D
1 stars 0 forks source link

snake improvements, input handling #20

Closed JeromeSchmied closed 1 week ago

JeromeSchmied commented 2 months ago

idea was to improve examples/snake.cpp, but one thing led to another and here are the (not yet done) results:

tui.hpp

doesn't brake existing code ( I suppose )

input

a pretty handy header with (I'd say) high-level functions and types to improve reading input from cin.

it's quite minimal though, uses macro magic (not intentionally, but it's needed to reduce code size and overcome some of c++ 's difficulties)

supported input:

[!IMPORTANT] caveats:

  • can't properly read Escape: there is a one character input delay, as there are Escape Sentences (like Arrows, F keys), which hence the name, start with an Escape
    • windows is weird, might get better

snake

examples

readme

updated accordingly

misc/ci

created CMakeLists.txt, that builds everything from examples.