PDA

View Full Version : glMatrixMode GL_TEXTURE vs display lists



01-21-2003, 06:25 AM
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 ?

01-21-2003, 06:56 AM
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.

01-21-2003, 07:12 AM
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
01-21-2003, 09:08 AM
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.

01-21-2003, 10:29 PM
I'm using the latest nVidia Detonater drivers on a GForce2/GTS board...

I always thought this was a stable driver ?

tester
01-24-2003, 07:52 AM
"I always thought this was a stable driver?"

Is there such a thing?! http://www.opengl.org/discussion_boards/ubb/wink.gif