PDA

View Full Version : BMP Texture problems



Le Bayonnais
03-10-2000, 06:10 AM
I try to diplay a texture, and only some type of BMP Files works...
Why??? And how to read a Gif or a Jpg file ??
Thanks
Le Bayonnais

bray
03-10-2000, 06:28 AM
I think you have to use a certain size for the bitmap file you are loading. such as a power of 2 (think binary)
32x64
or something like that, dont use wierd sizes like 33x101, loaders just dont like that

you need to get a reader program if you want to use .jpg, .gif, .rgb, or anything for that matter!
there are some exaples in the siggraph section of opengl.org's tutorials

Hude
03-12-2000, 09:28 PM
Well, it doesn't really matter... It has something to do with the data alignment. Are you using glPixelStore? Something like:

glPixelStoref(GL_UNPACK_SWAP_BYTES, 0);
glPixelStoref(GL_UNPACK_SKIP_ROWS, 0);
glPixelStoref(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStoref(GL_UNPACK_ALIGNMENT, 4); // word alignment

This controls how data is read from client memory.

dans
03-12-2000, 09:37 PM
You may have the problem of trying to load a 256 color bitmap when your loader is set up for RGB or RGBA bitmaps. (8 bit, 24bit, 32bit) so make sure your bitmaps are all the correct format for your loader. If you post the loader source code we can look to see what may be going wrong.