taking screenshots

What is the recommended way to programmically take screenshots in OpenGL
when using double-buffering?

I’m not asking how or for code, am I just asking if OpenGL needs to be
setup a certain way.

Does it matter if I read from the front or back buffer using glReadPixels?

Do I have to really care if glReadBuffer is set to GL_FRONT or GL_BACK?

I did a search, but it seems everyone just blindly calls glReadPixels
without much regard to how these variables are setup.

I’m just having a small problem, as I’m getting a couple lines of
garbage pixels at the bottom. Perhaps it has something to do with
the statusbar window on the bottom of my gl window. And I’m pretty
sure it has nothing to do with bad allocated memory.

glReadPixels reads from the frame buffer. So a suitable place to call it would be after you finish a render. When colors are written to the frame buffer, they are written into the color buffers specified by glDrawBuffer. Which defaults to GL_BACK in double buffered mode.

Jim