diff options
| author | roy <[email protected]> | 2026-07-07 03:16:29 +0300 |
|---|---|---|
| committer | roy <[email protected]> | 2026-07-07 03:16:29 +0300 |
| commit | 0c485f2df9125102c2945ffbdd00d2a781b39192 (patch) | |
| tree | 769a3bd41ea9f0596cbb4fe3131d594e93753112 | |
| parent | ff54dd7dc3d87efa1985c4c0261d987279822787 (diff) | |
Added leave game buffer to at exit
| -rw-r--r-- | terminal-game-utils.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/terminal-game-utils.hpp b/terminal-game-utils.hpp index 14eccea..aa540bb 100644 --- a/terminal-game-utils.hpp +++ b/terminal-game-utils.hpp @@ -179,11 +179,14 @@ inline void BGRGB(int r, int g, int b) { inline void TerminalColorReset() { std::cout << "\033[0m"; } // Game buffer printers: - -inline void EnterGameBuffer() { std::cout << "\033[?1049h"; } - +// inline void LeaveGameBuffer() { std::cout << "\033[?1049l"; } +inline void EnterGameBuffer() { + std::cout << "\033[?1049h"; + atexit(LeaveGameBuffer); +} + inline void MoveCursor(int row, int col) { std::cout << "\033[" << (row + 1) << ";" << (col + 1) << "H" << std::flush; } |
