system
January 21, 2003, 5:25am
1
Hi,
I used to scale all texture
coordinates like this :
glTexCoord2f( (vit)->tx xs, (vit)->ty ys );
But now I’m trying to use the texture matrix in a display list and for some reason my texture doesn’t display correctly:
glMatrixMode(GL_TEXTURE)
glLoadIdentity();
glScalef(xs,ys,1.0);
listid = glGenLists(1);
glNewList( listid, GL_COMPILE );
draw_objects()
glEndList();
What could be wrong ?
system
January 21, 2003, 5:56am
2
Hi,
I tracked down the problem :
Just after the call to glTexImage2D I check on glIsTexture, if it’s invalid, I don’t use the texture, otherwise I do.
But if I force the bind (ignore what glIsTexture returns) then the object displays correctly.
Is there a reason that glIsTexture returns false even if the texture (seems) to be valid ??
Ex :
glTexImage2D(GL_TEXTURE_2D, 0, 3,
l_iCols, l_iRows,
0, GL_RGB, GL_UNSIGNED_BYTE,
(char *) l_pGLTex->getPixels() );
if( glIsTexture(textureID) )
bValid = true
else bValid = false;
A bit further in the code I do :
if (bValid)
glBindTexture(…
else
continue…
U.
system
January 21, 2003, 6:12am
3
Okay maybe I should rephrase my problem :
// Texture gen code
glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(…
// Drawing code A) - No texture displayed
if( glIsTexture(textureID) == GL_TRUE )
glBindTexture(GL_TEXTURE_2D, textureID);
// Drawing code B) - Texture displays
glBindTexture(GL_TEXTURE_2D, textureID);
So why does glIsTexture returns GL_FALSE while it dipslays if I remove the check ?
Relic
January 21, 2003, 8:08am
4
Sounds like a driver bug, if I’ve read the specs correctly in the past.
Try glGenTextures for all your texture objects and see if glIsTexture can find it then.
system
January 21, 2003, 9:29pm
5
I’m using the latest nVidia Detonater drivers on a GForce2/GTS board…
I always thought this was a stable driver ?
tester
January 24, 2003, 6:52am
6
“I always thought this was a stable driver?”
Is there such a thing?!