PDA

View Full Version : Using windows colour macros in openGL



01-19-2006, 12:00 PM
Hi,

I'm using the statement glColor3f to set the colours in my program, but I need to use windows default colours. I was wondering if anyone could tell me how to use windows colour macros such as COLOR_ACTIVEBORDER, COLOR_BACKGROUND, COLOR_MENU etc. to set colours for openGL graphics primatives.

Thanks,

Woods

01-19-2006, 01:58 PM
The Windows API function GetSysColor returns a packed RGB triple. To extract the individual red, green and blue components you can use the Get(R|G|B)Value macros, then supply the returned components to glColor3ub(reg,green,blue). You could also normalize the components by dividing each by 255.0, then calling glColor3f, for example.

Cheers

01-20-2006, 11:59 AM
- Great. Thanks very much.