View Full Version : What's a good algorthim for loading images?

02-04-2006, 01:52 PM
I need to load an image for texture-mapping onto a cube, but the tutorial I was working for only covered bitmap loading algorthims for Windows. :rolleyes: All I need is a basic, platform independent, loading function for my program so I can do texture mapping. Can anyone help?

02-04-2006, 10:01 PM
a loader for uncompressed, true-color TGA images is very easy to realize. for the file format, go to wotsit.org (http://www.wotsit.org)

a tga basically consists of a small header (18 bytes usually) and 3*width*height bytes of color data in reversed order (BGR instead of RGB), which is not a problem, because you can call glTexImage2D(...) with a parameter GL_BGR.