GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


A Paste by godecho
1
 
unsigned int pixelsPerRow = (bytesPerPixel * texture.width);

GLubyte *temp = new GLubyte[pixelsPerRow];
        
GLubyte *start = texture.pImageData;
GLubyte *end = texture.pImageData+(pixelsPerRow * (texture.height - 1));

while(start < end)
{
    memcpy(temp,    start,    pixelsPerRow);
    memcpy(start,    end,    pixelsPerRow);
    memcpy(end,    temp,    pixelsPerRow);
    start    += pixelsPerRow;
    end    -= pixelsPerRow;
}
        
delete [] temp;