Loading BMP file using C++

Hello ,

Is there any good example code with explanation for loading BMP file for texturing using C++ ?
I tried to take a look at Nehe.gamedev.net and they are using some old GLAUX.h which does not exist any more and one of the other video tutorial website does not show how they loaded the bmp files they just showed how to apply loaded bmp file for texturing.

Chayan Vinayak

I would suggest using a pre-existing library, such as SDL for this kind of thing.
But if you really want to do it yourself, this was the first result on google:
If you know the width and height of the image, you can create an opengl texture using the bitmapImage as the image data, but that may not work, I haven’t tested it.

Why did u create another thread? Alfonse has already given a comprehensive reply here http://www.opengl.org/discussion_boards/…0828#Post300828

Thanks Keelx !
@keelx : I posted the thread on one of the another Opengl websites and someone posted following reply.( Thought I should share )