Texturing problem

Im loading some TGAs… but if I do not use gluBuild2DMipmaps the texture are not shown,

Code:

glBindTexture(GL_TEXTURE_2D,textures[nextFreeGlTextures].glName);

gluBuild2DMipmaps( GL_TEXTURE_2D,
3,
texture->GetImageWidth(),
texture->GetImageHeight(),
GL_RGBA,
GL_UNSIGNED_BYTE,
texture->GetPixels());

glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
texture->GetImageWidth(),
texture->GetImageHeight(),
0,
GL_RGBA ,
GL_UNSIGNED_BYTE,
texture->GetPixels());

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);

Check some documentation about glTexImage2D and see what is says about the width and height of the texture.

Or if you don’t want to, they both have to be a power of two.

Thanks Bob, I forgot this detail.

But the texture have some quality-loss, why?

Ps: Im loading a TGA but only 3 color components (GL_RGB).

Thanks Bob