Archived

This topic is now archived and is closed to further replies.

yzzid

Unpack alignment

Recommended Posts

yzzid    146
Is glPixelStorei(GL_UNPACK_ALIGNMENT, 1) needed only for textures that aren''t sized by a power of 2? I am wondering because I never use this call and never had a problem until recently. I added this call and my textures were OK. They were not sized by powers of 2. -dizzy

Share this post


Link to post
Share on other sites
Brother Bob    10344
Unpack alignment tells OpenGL the byte alignment for each row. For unpack alignment 4 (default), each new row must start on 4 byte boundary (the address must be divisible by 4). This is generally no problem for power of two textures, since if the first row starts on 4 byte boundary, then so do all rows. Problems can arise when the picture is a non power of two, and you may have to set the unpack alignment to something other than th default.

Share this post


Link to post
Share on other sites