I need help texturing a glutSolidCube

Can anyone provide me with some code on how I can map a .bmp or .tga texture file (say, 128128 or 256256) onto a glutSolidCube object? Rewriting my program to use GL_QUADS isn’t an option. I’ve spent all day looking for info on this, and it sounds like it’s possible but I can’t find any code.

Thanks!

You can only texture glutSolidTeapot because its the only one with texturing co-ordinates

Use GLU to create a cube instead, then you can enable texture coordinate generation.

Thanks Bob, do you have a link with info on how to do this?

Hmm, seems like GLU doesn’t draw cubes…

Either you must draw the cube yourself, or use OpenGL’s automatic texturecoordinate generation.

For automatic texturecoorinate generation, check out the Red Book , chapter 9. And by the way, why can’t you draw the cube yourself?

I’ll look into redrawing all the cubes in my program, it might not require me to rewrite most of my functions as I first though.

Thanks for the help.