1. When you are reading pixels as the memory texture, you have to put your glReadPixels() behind :
glGenTextures();
glBindTexture();
Or, some weird texture binding failure will happen…
2. When reading RGBA - with alpha, you have to make sure that alpha channel is 8 bits, which is not always the case even after you set GLUT_RGBA. For example, my laptop is OpenGL 2.1/ATI Radeon Mobile 4300, it works if I don't indicate GLUT_ALPHA. While on the computers in my lab, they are all OpenGL 3.2/nVidia, I have to set GLUT_RGBA manually.
The above two took me hours to figure out... subtle!