Bitmap readers for texture

If I want to create my own bitmap/picture file reader (in any format, .jpg, .tga, .bmp, etc…), what kind of information I need to extract from a picture to later use texture map?
Is there a information page that give specification on what openGL needs to get before creating a Texture map object?

Thank you

I am using .raw files. they are big but the reading routine is easy… search for .raw on apple.developer.com or in this forum

For the specification, look at the man page for glTexImage2D: you need to supply the width and height in pixels, the format and type of the data, and a pointer to the data.

It is certainly possible to write your own image loader for every file type and parse this information out, but other than for the experience, why would you? Use QuickTime or NSImage or other preexisting image libraries.

It is actually for the experiance. I could copy somebody else code or use existing lib and I will probably start with it as you suggested but I like also to get my hands “drity” of code. :slight_smile:

This might help…

http://www.ijg.org/

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.