|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metsci.glimpse.gl.texture.AbstractTexture
public abstract class AbstractTexture
An abstract Texture
implementation which wraps an OpenGL
integer texture handle but makes no assumptions about the
data types stored in the texture.
Constructor Summary | |
---|---|
AbstractTexture(int n0)
|
|
AbstractTexture(int n0,
int n1)
|
|
AbstractTexture(int n0,
int n1,
int n2)
|
Method Summary | |
---|---|
void |
dispose(javax.media.opengl.GLContext context)
Disposes all Java heap and GPU resources associated with this texture. |
int |
getDimensionSize(int n)
Given a dimension index (0, 1, or 2) returns the number of data elements in the texture along that dimension. |
int |
getNumDimension()
Returns whether the texture is a 1-dimensional, 2-dimensional, or 3-dimensional texture. |
boolean |
isDirty()
Indicates whether makeDirty() has been called. |
boolean |
isResident(javax.media.opengl.GL gl)
OpenGL implementations may swap store a "working set" of textures in a very fast cache of texture memory. |
void |
makeDirty()
Most Texture implementations are backed by a buffer on the heap which acts as a staging area for data changes to the texture. |
boolean |
prepare(javax.media.opengl.GL gl,
int texUnit)
Allocates space for the texture in GPU texture memory (once, if this is the first time that prepare( GL, int) has been called), copies texture
data from the heap into GPU memory (if isDirty() is true). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTexture(int n0)
public AbstractTexture(int n0, int n1)
public AbstractTexture(int n0, int n1, int n2)
Method Detail |
---|
public void makeDirty()
Texture
makeDirty()
indicates that the
contents of this buffer has changed and the new data should
be copied to the GPU.
makeDirty
in interface Texture
public boolean isDirty()
Texture
makeDirty()
has been called. Once
makeDirty()
is called, isDirty()
will return
true until prepare( GL, int )
is called and the tecture
data is copied to the GPU.
isDirty
in interface Texture
public int getNumDimension()
Texture
getNumDimension
in interface Texture
public int getDimensionSize(int n)
Texture
getDimensionSize
in interface Texture
n
- the texture dimension to query
public boolean isResident(javax.media.opengl.GL gl)
Texture
isResident( GL )
indicates whether this texture is resident in texture memory.
isResident
in interface Texture
gl
- a GL handle for the active GLContext
public boolean prepare(javax.media.opengl.GL gl, int texUnit)
Texture
prepare( GL, int)
has been called), copies texture
data from the heap into GPU memory (if isDirty()
is true). This texture
is then made active on the provided texture unit (using glActiveTexture()
)
and bound as the current GL_TEXTURE_1D
, GL_TEXTURE_2D
, or
GL_TEXTURE_3D
as appropriate based on getNumDimension()
. Once this
is complete, the texture is ready to be used by a
GlimpsePainter
.
prepare
in interface Texture
gl
- a GL handle for the active GLContexttexUnit
- the texture unit to bind to this texture
public void dispose(javax.media.opengl.GLContext context)
Texture
dispose
in interface Texture
context
- the active GLContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |