View Full Version : How to load bmp files for texturing in C++

Chayan Vinayak
07-28-2011, 06:09 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.

Chayan Vinayak

Alfonse Reinheart
07-28-2011, 07:10 PM
Use one of these (http://www.opengl.org/wiki/Related_toolkits_and_APIs#Image_and_Texture_Librar ies).

Chayan Vinayak
07-29-2011, 10:03 AM
Thanks Alfonse !

Chayan Vinayak
08-02-2011, 07:24 AM
I tried using SOIL library. I copied all the header files,SOIL.h and SOIL.c file in the same folder where my Main.cpp file is and then I imported files in the project(by dragging and dropping the files), I also put all header files and SOIL.h file in 'Header files' folder and SOIL.c in 'Source Files' but still main.cpp is not recognizing the SOIL functions.

08-02-2011, 03:26 PM
Or - you could take a look at this short, self-contained, demo that loads .bmp files and displays them as images (glDrawPixels) and textures. Source code is included ....