#75754 - Dark Knight ez - Wed Mar 15, 2006 7:27 pm
Hello.
I've been adding textured and non-textured quads to a 3D environment on the NDS. For textured quads I'm using code similiar to this:
For untextured quads, I just leave out the glBindTexture call and the glTexCoord2f calls.
When using both in the same program, my untextured quads seem to use the colour of the texture which has been bound by the last executed glBindTexture call, even though I'm not attaching that texture with glTexCoord2f calls.
This is not at all what I want. I just want it to use the colour specified by glColor3f, not affected by textures I use.
Am I doing something wrong? Is there a call to unbind textures (temporarily)? Or is this a bug in libnds?
Thanks in advance.
Dark Knight ez.
I've been adding textured and non-textured quads to a 3D environment on the NDS. For textured quads I'm using code similiar to this:
Code: |
glBindTexture(GL_TEXTURE_2D, *texture);
glBegin(GL_QUADS); glColor3f(1.0f, 1.0f, 1.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(xstart, tracksCenterY, zstart - depth); glTexCoord2f(1.0f, 1.0f); glVertex3f(xstart + width, tracksCenterY, zstart - depth); glTexCoord2f(1.0f, 0.0f); glVertex3f(xstart + width, tracksCenterY, zstart); glTexCoord2f(0.0f, 0.0f); glVertex3f(xstart, tracksCenterY, zstart); glEnd(); |
For untextured quads, I just leave out the glBindTexture call and the glTexCoord2f calls.
When using both in the same program, my untextured quads seem to use the colour of the texture which has been bound by the last executed glBindTexture call, even though I'm not attaching that texture with glTexCoord2f calls.
This is not at all what I want. I just want it to use the colour specified by glColor3f, not affected by textures I use.
Am I doing something wrong? Is there a call to unbind textures (temporarily)? Or is this a bug in libnds?
Thanks in advance.
Dark Knight ez.