gluBuild2dMipmaps(glu32) unknow ufo error

I have big problems with the function gluBuild2DMipmaps, I don’t think anyone will be able to solve this, well let’s try :

glBindTexture(GL_TEXTURE_2D, texture[1]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TexImg[0]->sizeX, TextImg[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TexImg[0]->data);

// /w MipMaping the texture…

glBindTexture(GL_TEXTURE_2D, texture[2]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TexImg[0]->sizeX, TexImg[0]->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TexImg[0]->data);

//////////////////////////////////////
That works in C… as you see it’s nearly the same as non-mipmaping. Now HERE is my prob in VB6 : (you will recognise a bit NeHe)
//////////////////////////////////////

//THIS WORKS :
glTexParameteri glTexture2D, tpnTextureMagFilter, GL_LINEAR
glTexParameteri glTexture2D, tpnTextureMinFilter, GL_LINEAR_MIPMAP_LINEAR
glTexImage2D glTexture2D, 0, 3, wx, hx, 0, GL_RGB, GL_UNSIGNED_BYTE, TexImg(0, 0, 0)

// /w MipMaping it DOESN’T WORK :
glTexParameteri glTexture2D, tpnTextureMagFilter, GL_LINEAR
glTexParameteri glTexture2D, tpnTextureMinFilter, GL_LINEAR_MIPMAP_LINEAR
gluBuild2DMipmaps glTexture2D, 3, wx, hx, tiRGB, pxlBitmap, TexImg(0, 0, 0)

///////////////////////////////////////////

Arghhh ! It stucks here ! A critical GLU32.dll error raises !

TexImg(0) is a GLuInt pointer. I don’t think it’s something to do with the RGB map…

Tell me why ! It’s exactly the same as in C code, maybe :

1- Dll entries are messed up ?
2- OGL TLB has limits or wrong enum ?
3- or… tell me !

Help will be greatly appreciated because my project is stucked here… and please say if I will have more of theese using a derived language such as VB instead of natural C… thanks

Dave

[This message has been edited by Crusader (edited 09-17-2000).]

The first thing I notice is that the code you posted doesnt include the call to glBindTexture. If you forgot this, that should be your problem. Assuming you did call that function and just forgot to paste it in your message:

I dont work in VB all that often, but this also sounds like you could have the DLL function declarations wrong. Maybe you can post your declaration of gluBuild2DMipmaps here and I (or someone else more familiar with VB + OpenGL) can make sure its alright. While we are at it, maybe you could also show us how glTexture2D, tiRGB, and pxlBitmap are defined just to make sure you have them right.

Besides these 2 problems, I dont know what could be wrong

Here If forgot to mention this in the VB part of the code :

//Create The Texture
glGenTextures 1, Texture(0)

//Typical Texture Generation Using Data From The Bitmap
glBindTexture glTexture2D, Texture(0)

But this doesn’t change my prob

Warning, my code works perfect with glTexImage2D, it’s only with func 2dMipMaps.

I tried some obsolete TextureImage(0,0,0) and I didn’t got the same critical error that even SHUT VB… it only said

  • 9 “Subscript out of range” and I could continue on VB…

So the func address is allright I presume ?

But WHY, WHY WHY in C it works with no trouble now I’ve got an headache ?

is it the GLAux C func : AUX_RGBImageRec or auxDIBImageLoad ?

or the C type definition texture[] holds
differently the data than VB:

texture(0) =? texture(0,0,0)

=? I don’t mean equal, but looking for another data container maybe

Damn… I really don’t understand

Do you use a card with a 3Dfx chipset? if that’s the case, you won’t achieve any results with the standard glu32.dll. But the failed MipMap function is not a reason for stopping your project. You can do it manually with repeated calls to glTexImage2D and a different level param. I don’t know if that helps you but good luck

gota 3dfx SLI and I can initialize GLU very well,

-But in the case of MipMaps it is a nVidia TNT1 (V550) that causes trouble

if any hads problems I got the trick :

When passing GLbyte -> GLuint there is a convert error.

No “CLng” fog GL so use this :

VarPtr(texture(0,0,0))