MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ initialize_console_colors()

static bool Lila::Commentator::initialize_console_colors ( )
inlinestaticprivate

Definition at line 246 of file Commentator.hpp.

247 {
248#ifdef _WIN32
249 // Enable ANSI escape sequences on Windows 10+
250 HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
251 if (hOut == INVALID_HANDLE_VALUE) {
252 return false;
253 }
254
255 DWORD dwMode = 0;
256 if (!GetConsoleMode(hOut, &dwMode)) {
257 return false;
258 }
259
260 dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
261 if (!SetConsoleMode(hOut, dwMode)) {
262 // Fallback: colors not supported on this Windows version
263 return false;
264 }
265 return true;
266#else
267 // Unix/Linux/macOS: ANSI colors always supported
268 return true;
269#endif
270 }