PDA

View Full Version : glClearColor



guju
05-20-2002, 11:44 AM
I want to set the background color. From Qt i get the color-rgb values from 0-255 for each. If i pass these values to glClearColor, the clors are not always the right. If i divide these values by 255 it look much better. Is this process correct, do i have to normalize the color values?
Thanks
juergen

Mazy
05-20-2002, 12:21 PM
The clearColor function takes floats as inParameters, and those should be between 0-1 where 0=no value, and 1=max value..
0,0,0,x = black
1,1,1,x = white
(x = whatever alpha you want to clear with)

/Mikael

nexusone
05-20-2002, 12:22 PM
The values of the glClearColor are between 0 and 1. And the varaible should be a float.

example:

glClearColor(0.0, 0.5, 1.0);

float's 0.0, 0.25, 0.5, 0.75, 1.0;



Originally posted by guju:
I want to set the background color. From Qt i get the color-rgb values from 0-255 for each. If i pass these values to glClearColor, the clors are not always the right. If i divide these values by 255 it look much better. Is this process correct, do i have to normalize the color values?
Thanks
juergen