public class GlTextureName
extends java.lang.Object
This class exists to implement the finalize method and thereby reduce the likelihood of OpenGL resource leaks. However, it is not foolproof, for two reasons. First, there is no guarantee that a texture name will ever be finalized. Second, to call glDeleteTextures, a texture name must lock an OpenGL context, and the only context it knows is the one in which it was constructed. That context may have been disposed, but the texture name may have been shared in a different unknown context. In this case, texture resources may be leaked in that unknown context.
Constructor and Description |
---|
GlTextureName()
Constructs a texture name in the current OpenGL context.
|
public GlTextureName()
java.lang.IllegalStateException
- if the current OpenGL context is null.public int name()
public void dispose()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable