|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.ogl.GlTextureName
public class GlTextureName
An OpenGL texture name. When constructed, a texture name calls glGenTextures to generate a single texture name. When disposed, it calls glDeleteTextures to delete any OpenGL resources bound to that name. If not disposed explicitly, a texture name 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 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 Summary | |
|---|---|
GlTextureName()
Constructs a texture name in the current OpenGL context. |
|
| Method Summary | |
|---|---|
void |
dispose()
Disposes this texture name. |
protected void |
finalize()
|
int |
name()
Returns the integer name corresponding to this texture name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GlTextureName()
java.lang.IllegalStateException - if the current OpenGL context is null.| Method Detail |
|---|
public int name()
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 | |||||||||