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.

Thanks.

  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 @ www.google.com

  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.

header: http://cvs1.nvidia.com/OpenGL/include/shared/nv_dds.h
source: http://cvs1.nvidia.com/OpenGL/src/shared/nv_dds.cpp

  1. Use BMP with SDL, www.libsdl.org

Azdo

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

There should be some code to load a bitmap in the tutorials at http://nehe.gamedev.net/ 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.