Maping a BMP file

Hi, i’m completely new in openGL programming. I’m working in a project with 2D images in BMP format under Linux, i need to open a BMP file and display it. If someone has a sample code of how to do this please send me a mail.


  1. Don’t use BMP - use TGA + GLFW

or (more likely)

  1. Use DevIL - a super-duper image library
  1. Don’t use TGA - use PNG

  2. Sample code can be found @

  1. Don’t use PNG/TGA, use DDS

DDS has the benefit of allowing you to store cubemaps and mipmaps in a single file. Plus the compression method used is directly accepted by the hardware so you won’t have to decompress it on the CPU, just send it straight to the GPU.


  1. Use BMP with SDL,


[This message has been edited by Azdo (edited 01-21-2003).]

There should be some code to load a bitmap in the tutorials at Try downloading the tutorial on texture mapping. From memory there’s a function to load a bitmap in there somewhere.

Also if you don’t mind getting your hands dirty you could always code such a function yourself

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.