texture crash

Started by
0 comments, last by pIpEs ClaNGoR 21 years ago
when I load some bmps with gluBuild2DMipmaps() my program will crash and some bmps will load fine. I thought gluBuild2DMipmaps() would load any bmp and resize it. --------------------------- The pipes clangor all the time.
---------------------------The pipes clangor all the time.
Advertisement
gluBuild2DMipamps() will load any bmp and resize it. But:
1. Your data must be valid
2. Check the width and height params you are passing to gluBuild2DMipmaps. If width*height*components is greater than the size of the allocated buffer, it will crash.
3. set
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
brefore scaling.
EDIT: You can set it to the default value (4) after scaling. When I didnt set it to 1, the image wasnt scaled correctly.
Hope this will help


PM

Times change...

Excuse my poor english!

[edited by - PM on May 3, 2003 4:36:02 AM]
PM Times change...Excuse my poor english!

This topic is closed to new replies.

Advertisement