Loading JPEGs

does anyone know, how to load JPEGs? I´d like to load them as textures. I don´t need the fileformat and decompressing methods. If there is a library or something, which gives me the possibility to load it into memory i am totally happy.


Go to imagelib.org and use DevIL. It used to be OpenIL, its an image loading/utility library with OpenGL sytnax. Takes ALL the work out of loading, binding, mipmapping, and deleting images. And just like OpenGL it is for Open platform use. Ill show you how easy it is to load a image into opengl/ and mipmap it with devil. These 5 lines do it ALL.

ilGenImages(1, &WeaponImage);
ilDeleteImages(1, &WeaponImage);

and your cooking with gas. Easy huh?

Why did i idiot ask now, and not 2 years earlier?!

Thank you, it seems to be really great, just as OpenGL and OpenAL!


Do keep in mind that compressed JPG images may not be the best texture resources. The lossy compression that JPG uses will cause imperfections on your textures that will show especially when they get enlarged (close-ups).
I suggest you use PNG images and a PNG loader library. PNG also compresses images quite nicely, but in a lossless way.

Just my .02