When GL_TEXTURE_ENV_MODE
is set to GL_REPLACE
, drawing a vertex will use the color of the current texture coordinate in the currently bound texture.
I found out that binding to the default texture with glBindTexture(GL_TEXTURE_2D, 0)
has the same effect as calling glDisable(GL_TEXTURE_2D)
.
However a Stackoverflow answer here quotes the OpenGL spec that "(3.9.2.Texture Access) sampling from an incomplete texture will return (0,0,0,1)", where the default texture is initially an incomplete texture.
So I think I should always get black objects drawn in the given case, but in practice it behaves as if texturing is disabled.
Why doesn't binding to the default texture with GL_REPLACE
actually replace the color drawn?