Class ALspTextureObject
java.lang.Object
com.luciad.view.lightspeed.services.glcache.ALspGLResource
com.luciad.view.lightspeed.util.opengl.texture.ALspTextureObject
- Direct Known Subclasses:
ALsp2DTextureObject
Manages an OpenGL texture object. This abstract class provides the base
functionality to create, bind and destroy the texture object. Definition of
the texture image and other texture parameters is left up to implementing
classes.
- Since:
- 2012.0
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructs a newALspTextureObject
.protected
ALspTextureObject
(String aSourceString) Constructs a newALspTextureObject
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(ILcdGLDrawable aGLDrawable) Binds the texture object to its appropriate target.void
destroy
(ILcdGLDrawable aGLDrawable) Deletes the texture object owned by thisALspTextureObject
.abstract long
getBytes()
Returns the number of estimated bytes this texture object occupies.abstract int
Returns the OpenGL enumerant for the texture target to which this texture can be bound.int
Returns the OpenGL texture object id.protected void
init
(ILcdGLDrawable aGLDrawable) Creates a new OpenGL texture object.protected boolean
Returns true if this texture object has been destroyed.void
unbind
(ILcdGLDrawable aGLDrawable) Unbinds the texture object from its target (by binding texture object 0).Methods inherited from class com.luciad.view.lightspeed.services.glcache.ALspGLResource
getSourceString, isBound, toString
-
Constructor Details
-
Method Details
-
init
Creates a new OpenGL texture object. This method is called the first time this texture is bound. It may be extended to include initialization of the texture image (e.g. by callingglTexImage2D()
).- Parameters:
aGLDrawable
- the drawable
-
destroy
Deletes the texture object owned by thisALspTextureObject
.- Overrides:
destroy
in classALspGLResource
- Parameters:
aGLDrawable
- the drawable
-
bind
Binds the texture object to its appropriate target. Note that this method does not enable texture mapping on this target. This method invokesinit(ILcdGLDrawable)
the first time it is called.- Overrides:
bind
in classALspGLResource
- Parameters:
aGLDrawable
- the drawable- See Also:
-
unbind
Unbinds the texture object from its target (by binding texture object 0). Note that this method does not disable texture mapping on this target.- Overrides:
unbind
in classALspGLResource
- Parameters:
aGLDrawable
- the drawable- See Also:
-
getTarget
public abstract int getTarget()Returns the OpenGL enumerant for the texture target to which this texture can be bound. Allowed values include GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP...- Returns:
- the OpenGL enumerant for the texture target to which this texture can be bound
-
getBytes
public abstract long getBytes()Returns the number of estimated bytes this texture object occupies.- Specified by:
getBytes
in classALspGLResource
- Returns:
- the number of estimated bytes this texture object occupies
-
isDestroyed
protected boolean isDestroyed()Returns true if this texture object has been destroyed. No attempts to use the texture should be made at this point.- Returns:
- whether or not this texture has already been destroyed
- See Also:
-
getTextureObject
public int getTextureObject()Returns the OpenGL texture object id. Will be -1 if the texture is not valid.- Returns:
- the OpenGL texture object id
-