Skip to content

Commit

Permalink
Detect high color support on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
magiblot committed May 28, 2021
1 parent 370d221 commit e5c1ac7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/platform/win32con.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ int Win32Display::getColorCount()
{
// Conhost has had high color support for some time:
// https://devblogs.microsoft.com/commandline/24-bit-color-in-the-windows-console/
// TODO: find out if we can be more accurate.
DWORD consoleMode = 0;
GetConsoleMode(StdioCtl::out(), &consoleMode);
if (consoleMode & ENABLE_VIRTUAL_TERMINAL_PROCESSING)
return 256*256*256;
return 16;
}

Expand Down

0 comments on commit e5c1ac7

Please sign in to comment.