I'm writing a terminal game for Windows, and the refresh was quite slow so I asked here
for help.
std::cout << "\33[2J\33[H"; // They told me to write this...
system("cls") // ...instead of this
But sending that ASCII escape sequence just makes the terminal "scroll", without deleting anything.
Lets say I really want to delete the old frames sometimes: how should I do it?
Just to make an example, they told me that...
std::cout << '\n'; // This...
std::cout << std::endl; // ...was faster than this
Then I asked what was missing to \n
to become equivalent to std::endl
, and they told me std::flush
.
So my question is: what is missing to \33[2J\33[H
to be equivalent to system("cls")
?