tests/cuda2.2/sdk/rendercheck_gl.cpp
bool CheckBackBuffer::readback( GLuint width, GLuint height, unsigned char *memBuf )
{
    // let's flip the image as we copy
    for (unsigned int y = 0; y < height; y++) {
        memcpy( (void *)&(m_pImageData[(height-y)*width*m_Bpp]), (void *)&(memBuf[y*width*m_Bpp]), width*m_Bpp);
    }
	return true;
}
//////////////////////////////////////////////////////////////////////
//  readback 
//
//   Code to handle reading back of a system memory buffer
//
//////////////////////////////////////////////////////////////////////
readback
Code to handle reading back of a system memory buffer
readback Code to handle reading back of a system memory buffer
bool CheckBackBuffer::readback( GLuint width, GLuint height, unsigned char *memBuf )
{
    for (unsigned int y = 0; y < height; y++) {
        memcpy( (void *)&(m_pImageData[(height-y)*width*m_Bpp]), (void *)&(memBuf[y*width*m_Bpp]), width*m_Bpp);
    }
	return true;
}
bool CheckBackBuffer :: readback ( GLuint width , GLuint height , unsigned char * memBuf ) { for ( unsigned int y = 0 ; y < height ; y ++ ) { memcpy ( ( void * ) & ( m_pImageData [ ( height - y ) * width * m_Bpp ] ) , ( void * ) & ( memBuf [ y * width * m_Bpp ] ) , width * m_Bpp ) ; } return true ; }
readback
Code to handle reading back of a system memory buffer
readback Code to handle reading back of a system memory buffer
// let's flip the image as we copy