public abstract class GLSharedResources extends java.lang.Object implements javax.media.opengl.GLEventListener, GLGarbageSource
Constructor and Description |
---|
GLSharedResources(javax.media.opengl.GLCapabilities cap) |
Modifier and Type | Method and Description |
---|---|
javax.media.opengl.awt.GLCanvas |
createCanvas()
Creates a canvas with the same capabilities and shared context
as other viewers using this set of resources.
|
javax.media.opengl.awt.GLJPanel |
createPanel()
Creates a canvas with the same capabilities and shared context
as other viewers using this set of resources.
|
void |
deregisterViewer(GLViewer viewer)
Unregisters a particular viewer with this set of resources.
|
void |
display(javax.media.opengl.GLAutoDrawable drawable) |
void |
dispose(javax.media.opengl.GL gl)
Clears all resources with the associated with the master
|
void |
dispose(javax.media.opengl.GLAutoDrawable drawable) |
void |
disposeResource(GLResource res) |
void |
garbage(javax.media.opengl.GL gl) |
long |
getGarbageCollectionInterval() |
javax.media.opengl.GLCapabilities |
getGLCapabilities()
Returns the capabilities of the underlying GL context
|
GLTexture |
getOrLoadTexture(javax.media.opengl.GL gl,
TextureContent content) |
GLTexture |
getTexture(javax.media.opengl.GL gl,
TextureContent content) |
void |
init(javax.media.opengl.GLAutoDrawable drawable) |
boolean |
isGarbageTimerEnabled() |
boolean |
maybeRunGarbageCollection(javax.media.opengl.GL gl)
Runs garbage collection if sufficient time has
passed since the last collection, as specified
by the garbage collection interval
|
void |
registerViewer(GLViewer viewer)
Register a particular viewer with this set of resources.
|
void |
reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height) |
void |
runGarbageCollection(javax.media.opengl.GL gl) |
void |
setGarbageCollectionInterval(long ms)
Time interval for running garbage collection, either with a
separate timed thread, or by manual calls to
maybeRunGarbageCollection(GL) . |
void |
setGarbageTimerEnabled(boolean set)
Enables or disables an automatic garbage timer.
|
void |
track(GLResource res) |
public GLSharedResources(javax.media.opengl.GLCapabilities cap)
public javax.media.opengl.GLCapabilities getGLCapabilities()
public void garbage(javax.media.opengl.GL gl)
garbage
in interface GLGarbageSource
public javax.media.opengl.awt.GLCanvas createCanvas()
public javax.media.opengl.awt.GLJPanel createPanel()
public void registerViewer(GLViewer viewer)
viewer
- the viewer with which to share resources.public void deregisterViewer(GLViewer viewer)
viewer
- public void dispose(javax.media.opengl.GL gl)
dispose
in interface GLGarbageSource
gl
- public GLTexture getTexture(javax.media.opengl.GL gl, TextureContent content)
public GLTexture getOrLoadTexture(javax.media.opengl.GL gl, TextureContent content)
public void init(javax.media.opengl.GLAutoDrawable drawable)
init
in interface javax.media.opengl.GLEventListener
public void dispose(javax.media.opengl.GLAutoDrawable drawable)
dispose
in interface javax.media.opengl.GLEventListener
public void track(GLResource res)
public void disposeResource(GLResource res)
public void runGarbageCollection(javax.media.opengl.GL gl)
public boolean maybeRunGarbageCollection(javax.media.opengl.GL gl)
gl
- public void setGarbageTimerEnabled(boolean set)
set
- public boolean isGarbageTimerEnabled()
public void setGarbageCollectionInterval(long ms)
maybeRunGarbageCollection(GL)
.ms
- time interval for collection in mspublic long getGarbageCollectionInterval()
public void display(javax.media.opengl.GLAutoDrawable drawable)
display
in interface javax.media.opengl.GLEventListener
public void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int width, int height)
reshape
in interface javax.media.opengl.GLEventListener