Texture Mapping?

I can’t seem to find a easy tutorial on texture mapping… NeHe seems ok but it uses Windows API stuff, and I’m trying to keep it generic.

All I want to do is map a background onto my scene. I have a BMP…but not sure if thats the format I should use or not?

Have you looked at the other formats available, look at the mac/unix ones I think they use glut, so no os specific api calls. I have been using jpgs recently as the jpg libs available are easy to compile on any os but are a bit big, ease of use tga probably…

you have the same problem I had. I couldn’t find any glut texture mapping tuts. So I just changed to win32 (like in NeHe)


I guess my real problem is I don’t know how to load bitmaps or any type of graphic file…all the tutorials say “we won’t tell you how to load the images”…

I figured out the rest of the stuff, I just dont know how to load the images. is there no functions in glut that do it for me?

GLUT does not load images for you.
http://nate.scuzzy.net/ got quite alot of nice pieces of code. Under “Common Code”, you find some code that loads .TGA files.

once you get the hang of tga have a look at…

I use mac/unix/irix and the code compiles ok on each of these for decompressing/compressing jpg’s.


This site might help: http://www.dcs.ed.ac.uk/home/mxr/gfx/2d-hi.html

All you have to do is look at the NeHe Texture Mapping tutorial and go down the bottom and find the GLUT conversion of the source code. Thats how I learned to map BMP images onto quads etc.