I’ve used gluBuild2DMipmaps successfully numerous times in the past, but I’ve run into something I’ve never seen before. I’ve always mipmapped with 256x256 textures (Voodoo3…) and had no problems. But because of some tesselation requirments of my geometry, I’ve recently had to pre-tesselate some of my images and pass gluBuild2DMipmaps textures which are 128x128 or 64x64 pixels. The 256x256 work with no problem, but the smaller ones cause an immediate Access Violation at address…in module ‘GLU32.DLL’…

I am running on Windows 2000 (yea… I know…) and developing with Borland CBuilder 5.0.

If it helps is a snippet of code (verbatim):

BYTE* rgba=(BYTE*)GI->Image->ScanLine[0];
int Failure = gluBuild2DMipmaps (GL_TEXTURE_2D,4,GI->Image->Width,GI->Image->Height,GL_RGBA,GL_UNSIGNED_BYTE,rgba);

Any suggestions?
Thanks in advance!

Put a breakpoint on the call that crashes, and double-check (and triple-check) that the values you are passing in are indeed correct.