Adding bmp image to gluSphere as texture

Can someone please explain how to add one simple texture to gluSphere in c++. I googled everywhere and i couldnt find it anywhere. Since I am a newbie explain step by step please…

I am not sure that glu library generates valid texture coordinates with the sphere mesh. You might have to create your own sphere with texture coordinates, it is not that hard.

For texture mapping, check this out:

I posted some code that does exactly what you are asking a while ago. It even includes the routines that load the .bmp file. A call to gluQuadricTexture is necessary to assign texture coordinates to the sphere. I think you’ll find that the code, some experimentation, and the ‘OpenGL Reference Manual’ are all you need in the way of ‘explanation’.

The source code and associated image files are at:

OpenGL Texture & Image Loading (.bmp format)

Good luck.

Thank you very much I will try everything you suggested and post back a reply


I am abviously dumb becouse nothing worked dam!
can you explain how to draw my own sphere with texture coordinates?
Some source code would realy help

Thanks in advance

Basic question - Do you know how to compile, link, and execute a c or cpp program on your system? If you not, you are in over your head trying to do OpenGL. If so, all the files necessary to render a textured gluSphere (including the source) are included in the directory referenced in my previous post. All you have to do is copy these files onto a folder on your system, then compile, link (to Glut and Glu), and execute.

It works it works jeeeeeee! The bloody problem was that stupid picture wouldnt load becouse of some realy strange reason, after 34h I rememberd that I can debug :slight_smile: Thank you for your help very much! Btw I solved the problem in a totaly different way, I can post source if you like :slight_smile:


i am phasing the same problem, i am new to openGL.
is it possible to display the code…

please guide me…waiting for your reply…