Sunday, 15 May 2011

floating point - Pixel color comparisons in Opengl -



floating point - Pixel color comparisons in Opengl -

i developing simple game requires color comparing of 2 pixels. have used glcolor3f set color. read pixel color next code. cannot compare float values. typecasting integer , comparing work ? typecasting float integer yield same result always. glcolor3i doesn't seem work. how can compare color values ?

float r,g,b; glubyte pixel[3]; glreadpixels(x, y, 1, 1, gl_rgb, gl_unsigned_byte, pixel); r = pixel[0]/255.0; g = pixel[1]/255.0; b = pixel[2]/255.0;

opengl floating-point integer

No comments:

Post a Comment