mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2025-12-19 14:32:48 +00:00
Add command-line option to show console output on Windows.
This commit is contained in:
parent
af3ad296ea
commit
e10f86593c
1 changed files with 16 additions and 0 deletions
|
|
@ -579,6 +579,22 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
for (int i = 1; i < argc; i++)
|
||||||
|
{
|
||||||
|
if (strcmp(argv[i], "--show-console") == 0)
|
||||||
|
{
|
||||||
|
if (GetConsoleWindow() == nullptr)
|
||||||
|
{
|
||||||
|
AllocConsole();
|
||||||
|
freopen("CONIN$", "r", stdin);
|
||||||
|
freopen("CONOUT$", "w", stderr);
|
||||||
|
freopen("CONOUT$", "w", stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set up console output to accept UTF-8 on windows
|
// Set up console output to accept UTF-8 on windows
|
||||||
SetConsoleOutputCP(CP_UTF8);
|
SetConsoleOutputCP(CP_UTF8);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue