JPEGLIB

My engine needs to be able to read JPEG files the best LIB ive found for this is the JPEGLIB. I was wondering if anyone knew of a site that has a good example of using JPEGLIB to draw the image on a square/cube in OpenGL and maybe has a tutorial explaining it.

Also Im not sure Im loading the file correctly. I think i screwed up jpeg_read_scanlines, the docs didnt really cover how to turn this into something OGL could read. Also the docs said to delete the jpeg header with jpeg_destory_decompress but its undefined. Can you take a look at the code please and tell me if anything is wrong?

Re: JPEGLIB

From the link given above...

Applications using the JPEG library should include the header file jpeglib.h to obtain declarations of data types and routines. Before including jpeglib.h, include system headers that define at least the typedefs FILE and size_t. On ANSI-conforming systems, including <stdio.h> is sufficient; on older Unix systems, you may need <sys/types.h> to define size_t.

Re: JPEGLIB

That error is because it is looking for the header in a linux (unix) file system...
Put the headers wherever you want, and make sure you have the right path for the header in your include statements...

Well, I am not sure if you are using linux already, since you are using g++. But is just an assumption.

Re: JPEGLIB

I moved the #include <jpeglib.h> and #include <jerror.h> to the bottom of my header list and it cleared that up. I forgot about the order. Im still getting a segment fault when I run. I think its because of the way I use jpeg_read_scanline if anyone could help me with that it would be great.

OpenIL seems like a good thing to use I might goto if I cannt get this to work. I just want to see if I can get this working.