+ 5
How to update console without flicker in c++?
I wrote a game program in c++ and i used system("cls") command to clear the screen amd update the console. But the system("cls") seems to be too slow and there is too much flicker. So is there an alternative to system("cls") command.
2 Answers
+ 9
void ClearScreen()
{
COORD cursorPosition; cursorPosition.X = 0; cursorPosition.Y = 0; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), cursorPosition);
}
Use this and #include <windows.h>
+ 3
B K thank you, the flickering stopped.