Bug with glDeleteTextures on bound textures

Hello everybody,

I think I found a strange behavior with OGL 1.0 & OGL ES 1.1 :

if a texture is bound and you delete it and create a texture just after, the new old texture number is used (normal) but the texture is flagged as invalid !

The solution is to bind on 0 manually after glDeleteTextures (glBindTexture(GL_TEXTURE_2D,0);).
BUT the documentation says “If a texture that is currently bound is deleted, the binding reverts to 0 (the default texture).”

It’s the same (wrong) behavior for me on Windows/Android/iOS.
You can test it with these few lines at home. Is it a bug or a wrong documentation ?

Stephane

GLuint tex;
glGenTextures(1,&tex);					
glBindTexture(GL_TEXTURE_2D,tex);			
GLboolean vIsTexture = glIsTexture(tex); // returns TRUE
glDeleteTextures(1,&tex);
glGenTextures(1,&tex);					
glBindTexture(GL_TEXTURE_2D,tex);			
vIsTexture = glIsTexture(tex); [b]// returns FALSE, it should not ![/b]
glDeleteTextures(1,&tex); 

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.