I’m tracking down a problem when I build mipmaps with gluBuild2DMipmaps.
I’ve isolated the problem to gluScaleImage (as you know gluBuild2DMipmaps calls gluScaleImage when the width or the height is non power of 2). My image is being damaged when I try to reduce it. I even tried requesting the original size from the routine, and it still damages the image!
The call looks like this:
int err = gluScaleImage(GL_RGB, 146, 84, GL_UNSIGNED_BYTE, img, 146, 84, GL_UNSIGNED_BYTE, (void *)newImg);
produces an image with a discolored line starting in the second row, and an x position of zero. It continues diagnally down the image towards the bottom. It almost looks like a classic alignment or pixel storage problem, but I’ve played around with glPixelStorei a little but to no avail. I’ve got ample storage for my destination image so I know its not blowing out of storage. And the maddening thing is it almost works – the image is almost perfect, leading me to believe there is some subtle problem.
Has anyone had a problem with gluScaleImage? It seems like I’m doing a fairly common operation here.