glReadPixels not getting color info

I’m trying to read current viewport:

glPixelStorei(GL_PACK_ALIGNMENT, 4);
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);

glReadPixels(0, 0, viewport[2], viewport[3], GL_RGB, GL_UNSIGNED_BYTE, pBits);

All of the args to glReadPixels are valid. However, I’m not getting anything into the allocated pBits buffer. Have tried every possible format: GL_RGBA, GL_BGR_EXT, GL_BGRA_EXT, GL_COLOR_INDEX but no luck. <sigh>

[This message has been edited by RJH (edited 07-10-2001).]