stryx
March 22, 2002, 11:24pm
1
Hi, I’m using Multitexturing this way:
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture[PICTURE_ID]);
and I draw it with:
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f, 1.0f);
glVertex3f(-1, 1, 1);
…
It works, but when I now want to draw things without Multitexturing It is black without any texture.
I do this like this:
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture[PICTURE2_ID]);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 1.0f); glVertex2f(-5, -5);
…
What am I doing wrong ?
Normal works. Multi works, but not together.
Help please,
Thanks
StryX
Bob
March 23, 2002, 2:13am
2
Do you disable the second texture unit when you dont’t need it anymore?
Switch to second texture unit
glActiveTextureARB(GL_TEXTURE1_ARB);
disable it
glDisable(GL_TEXTURE_2D);
switch back to first
glActiveTextureARB(GL_TEXTURE0_ARB);
Bob
March 23, 2002, 7:39am
6
I’m sorry, but I find it very amazing that people can enable stuff, but don’t know how to disable it. It should be very clear how to do if you read some (any!) documenation about it.
A rule: If you enable it with glEnable, you diable it with glDisable.
stryx
March 23, 2002, 7:44am
7
my problem was not to disable it.
I forgot to switch back to TEX 0.
Thanks anyway.
I agree to you ‘RULE’.
Bob
March 23, 2002, 8:31am
8
I apologise for being rude, but a question like “how to do that” just begs for an RTFM answer.
Anyways, glad we could help you.
zed
March 23, 2002, 10:16am
9
>>my problem was not to disable it.
I forgot to switch back to TEX 0.<<
this has gotten me as well before, until i remembered ‘opengl is a state machine’