Is there a way to check to see if an opengl texture name set with glGenTextures has still got a valid texture associated with it? In the documentation I see there is a function glIsTexture, but it is not clear if this function returns GL_FALSE, if the texture has been d开发者_开发百科eleted.
This is... complicated.
If you have called glDeleteTextures
on a texture name, then that name is no longer a texture... unless a later call to glGenTextures
returns that name again. See, once you delete a texture, OpenGL is free to use that name later on. It's like deleting a pointer; it is possible that later memory allocations will return exactly that pointer again.
All glIsTexture
can do is test to see if the texture is currently not a texture. It might become a texture again later.
精彩评论