PDA

View Full Version : Disabling 2D texture



Aekold
02-13-2008, 10:51 AM
Hi,
I've got source code like this:

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
CHECK_GL;
glBindTexture(GL_TEXTURE_2D, m_texture);

ASSERT(glIsTexture(m_texture));
CHECK_GL;

glBegin(GL_QUADS);
glTexCoord2d(0.0, 0.0);
glVertex3d(-m_paperData->GetPaperSize()/2.0, 0.0, -m_paperData->GetPaperSize()/2.0 );
glTexCoord2d(1.0, 0.0);
glVertex3d(m_paperData->GetPaperSize()/2.0, 0.0, -m_paperData->GetPaperSize()/2.0 );
glTexCoord2d(1.0, 1.0);
glVertex3d(m_paperData->GetPaperSize()/2.0, 0.0, m_paperData->GetPaperSize()/2.0 );
glTexCoord2d(0.0, 1.0);
glVertex3d(-m_paperData->GetPaperSize()/2.0, 0.0, m_paperData->GetPaperSize()/2.0 );
glEnd();
glBindTexture(GL_TEXTURE_2D, 0);
CHECK_GL;
glDisable(GL_TEXTURE_2D);

and then I have to render some primitives with color per vertex, no textures.
If I comment out glTexCoord2D commands - everything goes all right, but if not - under some angles some triangles randomly colored occur.
How can I cope with this (which GL commands may be used)?
Peter

Zengar
02-13-2008, 10:58 AM
Well, you have to disable texturing :) It is done with glDisable(GL_TEXTURE_2D)