Can someone tell me (perferably someone who was DJGPP) step-by-step how to color text? ThanksWhy are greenboards white?
Can someone tell me (perferably someone who was DJGPP) step-by-step how to color text? ThanksWhy are greenboards white?
I think it is in the FAQ.
Last edited by JoshG; 09-29-2002 at 06:14 AM.
gcc -lalleg
http://www.ciusa.net/~jrgrant/
The only way I know of is the windows.h function, SetConsoleTextAttribute.
------------------------------------------------------------------------------------
Function:
BOOL SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttributes)
Header File: windows.h
Parameters:
HANDLE hConsoleOutput - A handle to the window's screen buffer.
WORD wAttributes - The foreground/background color/intensity.
Example use:
------------------------------------------------------------------------------------Code:// The handle to the screen buffer HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE); // This will make green text on a blue background SetConsoleTextAttribute(stdOut, FOREGROUND_GREEN | FOREGROUND_INTENSITY |BACKGROUND_BLUE | BACKGROUND_INTENSITY);
Hope that helps!
Brendan
Draco dormiens nunquam titallandus.
Console Graphics Library: http://www.geocities.com/steve_alberto/cgl.html