jpeg on OpenGL?

Please tell how to load the .jpg file onto
OpenGL program. So that it can be used for
textures…

You want to get the intel JPEG library and use the functions they have to load the jpegs. You certainly won’t want to write the code out all by yourself. Lots of crazy compression algorithms to get past.

  • Halcyon

Gametutorials.com has an article on loading jpeg images that should help you:
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg2.htm

There is an open source library that reads just about any image format. Check out: http://www.paintlib.de/paintlib/