hyperion.ng/src/hyperiond/console.h

19 lines
496 B
C
Raw Normal View History

#include <Windows.h>
// https://stackoverflow.com/a/57241985
void CreateConsole()
{
if (!AllocConsole()) {
// Add some error handling here.
// You can call GetLastError() to get more info about the error.
return;
}
// std::cout, std::clog, std::cerr, std::cin
FILE* fDummy;
freopen_s(&fDummy, "CONOUT$", "w", stdout);
freopen_s(&fDummy, "CONOUT$", "w", stderr);
freopen_s(&fDummy, "CONIN$", "r", stdin);
SetConsoleTitle(TEXT("Hyperion"));
}