   [SDL] Inverted image
  I'm loading an image with SDL for texturing a polygon with OpenGL.But the image is loaded upside down."The solution is to turn the SDL surface upside-down before using it in glTexImage2D, so the rest of the program can use the normal OpenGL conventions. To do so, one can use a flip function, or directly save accordingly the flipped images beforehand. "I don't have idea how to do this   
  One option would be simply to set up your OpenGL texture coordinates to accommodate the image orientation.If you want to flip it, and if you're using an image loading API that offers a 'vertical flip' option (some do), use that.Otherwise, you can flip the SDL_Surface image data manually if you want. For this, you'll need to grab the image height, pitch and/or image width, and a pointer to the raw data, and swap the rows manually starting at the top and bottom and moving inward.   