Easiest way to get a jpg into opengl.

Started by
4 comments, last by Smurfwow 22 years ago
Hi, does anyone have any (as simple as possible) code that will read and bind a jpg into an opengl texture. (it doesn''t matter if it uses external libs or not). Thanks. and on a side note, does anyone know of any sites which are orientated specificly towards texture loading (apart from tga/bmp)
Advertisement
DevIL (Developers Image Library).
... and DevIL supports various other formats like .gif, .tif, .pcx and even .psd (photoshop)... (there are alot of more..)

just call init function (ilInit()) and load image (ilLoadImage(path))
If you want actual source code, you can look at this.

~CGameProgrammer( );

~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Use Intel''s library as I did. Its very simple to use and I got source code for loading JPEG images. See it in Material.h/cpp in Bezier Editor Project at the page with link at bottom.
Cheers.

" Do we need us? "


Ionware Productions - Games and Game Tools Development

your code was very usefull HellRiZZer, thanks heaps.

thanks for the sites aswell.

This topic is closed to new replies.

Advertisement