MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / clear_console

Function clear_console

basisu_tool.cpp:6249–6268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6247
6248#if CLEAR_WIN32_CONSOLE
6249void clear_console()
6250{
6251 //if (!IsDebuggerPresent())
6252 // return;
6253
6254 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
6255 CONSOLE_SCREEN_BUFFER_INFO csbi;
6256 DWORD consoleSize, charsWritten;
6257 COORD topLeft = { 0, 0 };
6258
6259 // Get console screen buffer info
6260 GetConsoleScreenBufferInfo(hConsole, &csbi);
6261 consoleSize = csbi.dwSize.X * csbi.dwSize.Y;
6262
6263 // Fill the entire screen with spaces
6264 FillConsoleOutputCharacter(hConsole, ' ', consoleSize, topLeft, &charsWritten);
6265
6266 // Set the cursor at the top left corner
6267 SetConsoleCursorPosition(hConsole, topLeft);
6268}
6269#endif
6270
6271//-----------------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected