You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 23, 2021. It is now read-only.
I am now using this library within my application, but wanted to report a small problem that there is.
The enum that contains the colors, should be move dinto the heaer file instead, as it can't be accessed otherwise.
I also have made a minimal piece of code that allows me to reset the console. I kinda picked the code up from stackoverflow and MSDN, but maybe it turns out to be useful.
#ifndefAP_HELPER#defineAP_HELPER#ifdefWIN32#include<windows.h>// Console attributes.HANDLEhConsole;
WORDsaved_attributes;
CONSOLE_SCREEN_BUFFER_INFOconsoleInfo;
voidinitConsole() {
HANDLEhConsole=GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFOconsoleInfo;
WORDsaved_attributes;
/* Save current attributes */GetConsoleScreenBufferInfo(hConsole, &consoleInfo);
saved_attributes=consoleInfo.wAttributes;
}
voiddeinitConsole() {
/* Restore original attributes */SetConsoleTextAttribute(hConsole, saved_attributes);
}
#else#include<stdio.h>// Nothing to do herevoidinitConsole() {}
voiddeinitConsole() {
printf("\e[0m");
}
#endif#endif