PDA

View Full Version : Loading BMP file using C++



Chayan Vinayak
07-28-2011, 04:50 PM
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.

Thanks
Chayan Vinayak

keelx
07-28-2011, 08:33 PM
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:
http://www.vbforums.com/showthread.php?t=261522
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.

mobeen
07-28-2011, 11:49 PM
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.

Thanks
Chayan Vinayak
Why did u create another thread? Alfonse has already given a comprehensive reply here http://www.opengl.org/discussion_boards/...0828#Post300828 (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Main=57998&Number=3008 28#Post300828)

Chayan Vinayak
07-29-2011, 10:07 AM
Thanks Keelx !
@keelx : I posted the thread on one of the another Opengl websites and someone posted following reply.( Thought I should share )


http://www.gamedev.net/topic/607344-loading-bmp-file-using-c/