Hi, I’m not sure if this is a bug or how OpenGL is supposed to work, but here it goes:
I use glActiveTexture(GL_TEXTURE0) for my Shader for one part of my image. However when I disable the program and glDisable(GL_TEXTURE_2D), the color of my bitmap fonts and my other calls are being taken from the previous active texture even though I’ve disable GL_TEXTURE_2D. I’ve set the color before drawing and for the bitmap font, I do set the color before calling glRasterPos. I’ve verified these colors are stored properly by calling glGet for both GL_CURRENT_COLOR GL_RASTER_COLOR. The only way it works properly is if I do the following after I’m done with the texture units:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
I don’t want to send a bug report in unless I’m sure it’s a bug. I’m using GLEW for my GLSL and my card has support for OpenGL 2.0 (which GLEW has shown to be true).
Here’s some pseudo code to show what I’m doing:
glEnable(GL_TEXTURE_2D);
glUseProgram(myShaderProgram);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, myFirstTexture);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, mySecondTexture);
…Draw some stuff…
glUseProgram(0);
glDisable(GL_TEXTURE_2D);
glColor3f(1.0, 1.0, 1.0);
…Draw Some more stuff…
If anyone knows if this is a bug, let me know