| 14 | static bool gConsoleFirstCommit; |
| 15 | |
| 16 | bool InitializeConsole() |
| 17 | { |
| 18 | gConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); |
| 19 | if (gConsoleHandle == INVALID_HANDLE_VALUE) { |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | CONSOLE_SCREEN_BUFFER_INFO info = {}; |
| 24 | if (GetConsoleScreenBufferInfo(gConsoleHandle, &info) == 0) { |
| 25 | return false; |
| 26 | } |
| 27 | |
| 28 | gConsoleTop = info.dwCursorPosition.Y; |
| 29 | gConsoleWidth = info.srWindow.Right - info.srWindow.Left + 1; |
| 30 | gConsoleBufferHeight = info.dwSize.Y; |
| 31 | gConsoleWriteBufferIndex = 0; |
| 32 | gConsolePrevWriteBufferSize = 0; |
| 33 | gConsoleFirstCommit = true; |
| 34 | |
| 35 | return true; |
| 36 | } |
| 37 | |
| 38 | static void vConsolePrint(char const* format, va_list args) |
| 39 | { |
no outgoing calls
no test coverage detected