Trouble with glReadPixels

Can someone tell me the useage of glReadPixels? Here’s my simple

read from RED(0-255 colors)
read one single pixel
return it to an integer called ‘select’

Well, it is very simple:


But also be sure you use glReadBuffer to read from the correct buffer. Also watch out for dithering artifacts if you are using this method to select polys. I think it would be better to use either the selection buffer or your own collision detection for selection code.