Name
glCopyTexImage2D — copy pixels into a 2D texture image
C Specification
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
Apparently, the pixels must be stored somewhere, but where? The function returns void and does not use a pointer parameter.
SO, where does glCopyTexImage2D save its pixels to?
Into a texture you specify as
target(e.g.GL_TEXTURE_2D, which would mean currently bound 2D texture). After using that you can useglGetTexImageto fetch the pixels from the texture to your own buffer.