diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-11-18 16:58:14 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-11-18 16:58:14 +0000 |
commit | 6f266c2afed6b3826dcbb15e5e1052e08eb02566 (patch) | |
tree | 53342026f70e7a6bc0a01f237353f40a1aa598d4 /src/libutil | |
parent | 46479c15010f8f936318ffb4673e78c4feb5c635 (diff) | |
download | glu-6f266c2afed6b3826dcbb15e5e1052e08eb02566.tar.gz |
additional fixes for mipmap building (Greg McGarragh)
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/mipmap.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libutil/mipmap.c b/src/libutil/mipmap.c index 5a62276..44f519a 100644 --- a/src/libutil/mipmap.c +++ b/src/libutil/mipmap.c @@ -3863,10 +3863,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); -#if 0 - /* don't change ROW_LENGTH until the non-power-of-two path below */ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); -#endif level = userLevel; @@ -3874,10 +3871,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (width == newwidth && height == newheight) { /* Use usersImage for level userLevel */ if (baseLevel <= level && level <= maxLevel) { + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glTexImage2D(target, level, internalFormat, width, height, 0, format, type, usersImage); } + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); if(levels == 0) { /* we're done. clean up and return */ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); @@ -4115,10 +4114,6 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, /* level userLevel+1 is in srcImage; level userLevel already saved */ level = userLevel+1; } else { /* user's image is *not* nice power-of-2 sized square */ -#if 1 - /* see above */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); -#endif memreq = image_size(newwidth, newheight, format, type); switch(type) { case GL_UNSIGNED_BYTE: |