public class GlDisplayList
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 display list will ever be finalized. Second, to call glDeleteLists, a display list 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 display list may have been shared in a different unknown context. In this case, display list resources may be leaked in that unknown context.
Constructor and Description |
---|
GlDisplayList()
Constructs a display list in the current OpenGL context.
|
GlDisplayList(int range)
Constructs display lists in the current OpenGL context.
|
public GlDisplayList()
java.lang.IllegalStateException
- if the current OpenGL context is null.public GlDisplayList(int range)
range
- the number of display lists.java.lang.IllegalStateException
- if the current OpenGL context is null.public int list()
public int range()
public void dispose()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable