Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / 3D Theory & Graphics / Image loader for OpenGL Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

February 27, 2005, 04:47 PM

Hello, I'm a starter with graphics. I am using OpenGL and I'm trying to go into Texture Mapping. OpenGL doesn't have an inbuilt image loader so I was thinking to make my own but I don't even know where to start from.
So I was wondering if someone can give me some directions or links with tutorials on the web about making one.

Is it hard to make one? I don't want anything fancy just a simple image loader.
And not loading every single image format out there; .jpg or .bmp even .raw will do.

[P.S] I know that google is our best "friend" but I have searched a lot without having any results, that's how I end up here in the first place ;)


February 27, 2005, 05:22 PM

You obviously haven't looked very hard. Look up BITMAPINFO in MSDN and RTFM...

Victor Widell

February 27, 2005, 05:32 PM

I would use SDL and SDL_image. Lots of fileformats, and "easy" to use. And platform independent.


February 27, 2005, 06:29 PM

I'd recommend DevIL. Here's how you load a texture in DevIL:

//init stuff (do once)

//load texture (for each texture):
GLuint tex = ilutGLLoadTexture("texture.bmp");

DevIL supports all important file formats.

Rui Martins

February 28, 2005, 09:03 AM

Try this
It loads Targa image Files, and you can have the source!

Just let me now if you decide to use it.


February 28, 2005, 09:48 AM

Guys thanks a lot for all your help, and I appreciate it!!
But as i said I am looking for something simple.

Rui Martins is there a way we can get in touch, messenger lets say?

Thanks in advance;



Rui Martins

February 28, 2005, 09:54 AM

Sorry no messenger at work!

Take a look at the code, it's easy to use.
Check the "Example Usage" too on the webpage.


February 28, 2005, 09:59 AM

Well whenever it's possible it's fine :)

Erik Faye-Lund

February 28, 2005, 11:38 PM

i'd just like to add that the current DevIL version loads all textures upside down in opengl due to a silly mistake. it's quite easy to fix in the source, though.


March 01, 2005, 04:58 AM

I use Devil. Very simple and very easy to use. Go to to get it

Rui Martins

March 01, 2005, 06:15 AM

Well whenever it's possible it's fine :)

I don't use MS Messenger, I use Yahoo's messenger.
Check my profile for contact.


March 01, 2005, 09:24 PM

go for devil.

This thread contains 12 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.