|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.ogl.GlDisplayList
public class GlDisplayList
An OpenGL display list. When constructed, a display list calls glGenLists to generate one or more display lists. When disposed, it calls glDeleteLists to delete any OpenGL resources bound to those lists. If not disposed explicitly, a display list will dispose itself when finalized during garbage collection.
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 Summary | |
|---|---|
GlDisplayList()
Constructs a display list in the current OpenGL context. |
|
GlDisplayList(int range)
Constructs display lists in the current OpenGL context. |
|
| Method Summary | |
|---|---|
void |
dispose()
Disposes this display list. |
protected void |
finalize()
|
int |
list()
Returns the integer index corresponding to this display list. |
int |
range()
Returns the number of display lists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public int list()
public int range()
public void dispose()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||