public static void SwitchBuffer() { NativeConsole.SetConsoleActiveScreenBuffer(buffers[currentBuffer]); currentBuffer = (currentBuffer + 1) % 2; currentHandle = buffers[currentBuffer]; NativeConsole.CHAR_INFO[] ci = new NativeConsole.CHAR_INFO[bufferSize.X * bufferSize.Y]; NativeConsole.SMALL_RECT rect = new NativeConsole.SMALL_RECT(0, 0, (short)(bufferSize.X - 1), (short)(bufferSize.Y - 1)); NativeConsole.WriteConsoleOutput(currentHandle, ci, bufferSize, new NativeConsole.COORD(), ref rect); NativeConsole.SetConsoleCursorPosition(currentHandle, new NativeConsole.COORD(0, 0)); }