MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / SetConsoleForegroundColorPrimary

Function SetConsoleForegroundColorPrimary

source/print.cpp:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace spvtools {
21
22static void SetConsoleForegroundColorPrimary(HANDLE hConsole, WORD color) {
23 // Get screen buffer information from console handle
24 CONSOLE_SCREEN_BUFFER_INFO bufInfo;
25 GetConsoleScreenBufferInfo(hConsole, &bufInfo);
26
27 // Get background color
28 color = WORD(color | (bufInfo.wAttributes & 0xfff0));
29
30 // Set foreground color
31 SetConsoleTextAttribute(hConsole, color);
32}
33
34static void SetConsoleForegroundColor(WORD color) {
35 SetConsoleForegroundColorPrimary(GetStdHandle(STD_OUTPUT_HANDLE), color);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected