I would expect the following to give me same result
float pixelf[3];
glReadPixels(x, y, 1, 1, GL_RGB, GL_FLOAT, pixelf);
GLuint pixelui[3];
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_INT, pixelui);
unsigned char pixelub[3];
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixelub);
cout << "r: " << pixelf[0] << " g: " << pixelf[1] << " b: " << pixelf[2] << endl;
cout << "r: " << pixelui[0] << " g: " << pixelui[1] << " b: " << pixelui[2] << endl;
cout << "r: " << pixelub[0] << " g: " << pixelub[1] << " b: " << pixelub[2] << endl;
however, my result is this:
r: 0 g: 1 b: 0
r: 0 g: 4294967295 b: 0
r: g: � b:
the pixel is green, so the float result is correct (0,1,0). Why are the other results so crazy!?
Thanks,
Dave