Skip to content

Commit efc033e

Browse files
committed
修复细节
1 parent 0ecbaf0 commit efc033e

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

darwin.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
1818
* Github: https://github.com/mikecovlee
1919
*/
20-
#ifndef CS_DEBUG
2120
#define DARWIN_DISABLE_LOG
22-
#endif
2321
#define DARWIN_FORCE_BUILTIN
2422

2523
#include <darwin/darwin.hpp>

include/darwin/win32_conio.hpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,26 @@ namespace conio {
110110

111111
static void clrscr()
112112
{
113-
system("cls");
113+
static CONSOLE_SCREEN_BUFFER_INFO csbi;
114+
static DWORD dwWritten;
115+
GetConsoleScreenBufferInfo(
116+
StdHandle,
117+
&csbi);
118+
FillConsoleOutputAttribute(
119+
StdHandle,
120+
csbi.wAttributes,
121+
csbi.dwSize.X * csbi.dwSize.Y,
122+
{0, 0},
123+
&dwWritten);
124+
FillConsoleOutputCharacterW(
125+
StdHandle,
126+
L' ',
127+
csbi.dwSize.X * csbi.dwSize.Y,
128+
{0, 0},
129+
&dwWritten);
130+
SetConsoleCursorPosition(
131+
StdHandle,
132+
{0, 0});
114133
}
115134

116135
static int getch()

0 commit comments

Comments
 (0)