Using C++ for a cross platform console app, is there any way to implement a display which is static and dynamically changing, rather than an output which prints under the previous output? I.e. For a simple board game, rather than reprinting the board each turn, update a single output.
Edit: AFAIK, unicode is not entirely necessary, I am using only characters which appear on a standard EN-GB keyboard.
I'll look into NCURSES, although I was wondering if there something within the C++ standard which could help me achieve this. Call me ignorant if you like, but I'm just wondering.
I think NCURSES is what you're looking for. Terminal wrapper for ConsoleUI, which is cross-platform. It allows you to write to a virtual screen buffer, and control when and how the refresh is being done. It does internal book-keeping of that buffer and will only refresh the characters which changed. Curses was designed in days where connection speed mattered so terminal refresh operations were being done in a smart way.
There's an ncurses tag at SO, so you'll find a lot of information here about the gritty details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With