Archived

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

Unpack alignment

This topic is 5535 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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