-
Notifications
You must be signed in to change notification settings - Fork 0
/
vividConsole.cpp
58 lines (43 loc) · 1.25 KB
/
vividConsole.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "vividConsole.h"
void vividConsole::print( const char* string ){
std::cout << string << std::endl;
}
void vividConsole::printSuccess ( const char* string ){
setBgColor( CONSOLE_BLACK );
setFgColor( CONSOLE_GREEN | CONSOLE_BRIGHT );
std::cout << "SUCCESS: ";
setDefault();
std::cout << string << std::endl;
}
void vividConsole::printError( const char* string ){
setBgColor( CONSOLE_BLACK );
setFgColor( CONSOLE_RED | CONSOLE_BRIGHT );
std::cout << "ERROR: ";
setDefault();
std::cout << string << std::endl;
}
void vividConsole::printWarning( const char* string ){
setBgColor( CONSOLE_BLACK );
setFgColor( CONSOLE_YELLOW );
std::cout << "WARNING: ";
setDefault();
std::cout << string << std::endl;
}
void vividConsole::printDestroy( const char* string ){
setBgColor( CONSOLE_BLACK );
setFgColor( CONSOLE_PURPLE );
std::cout << "DESTROY: ";
setDefault();
std::cout << string << std::endl;
}
void vividConsole::calcColor() {
this->color = (this->bg_color * 16) + this->fg_color;
SetConsoleTextAttribute( this->handle, this->color );
}
void vividConsole::setDefault(){
setBgColor( CONSOLE_BLACK );
setFgColor( CONSOLE_WHITE | CONSOLE_BRIGHT );
}
vividConsole::vividConsole(){
this->handle = GetStdHandle(STD_OUTPUT_HANDLE);
}