anl.aida.viz3d
Class TextureDrawable

java.lang.Object
  extended by anl.aida.viz3d.TextureDrawable
All Implemented Interfaces:
StackDrawable

public class TextureDrawable
extends java.lang.Object
implements StackDrawable

Draws a texture on to a unit sized rectangle.


Field Summary
private  float[] coords
           
private  java.awt.image.BufferedImage img
           
private  long sortIndex
           
private  com.sun.opengl.util.texture.Texture texture
           
 
Constructor Summary
TextureDrawable(java.awt.image.BufferedImage img, long sortIndex)
           
 
Method Summary
private  void createTexture()
           
 void dispose()
          Dispose of any resources this StackDrawable may be holding.
 void draw(javax.media.opengl.GL gl)
          Draws the drawable using the current OpenGL interface.
 long getSortIndex()
          Gets an index that can be used to sort this drawable.
 void init()
          Initializes this StackDrawable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

texture

private com.sun.opengl.util.texture.Texture texture

img

private java.awt.image.BufferedImage img

sortIndex

private long sortIndex

coords

private float[] coords
Constructor Detail

TextureDrawable

public TextureDrawable(java.awt.image.BufferedImage img,
                       long sortIndex)
Method Detail

init

public void init()
Description copied from interface: StackDrawable
Initializes this StackDrawable. This may be called multiple times during the life of this StackDrawable in response to OpenGL context changes.

Specified by:
init in interface StackDrawable

dispose

public void dispose()
Description copied from interface: StackDrawable
Dispose of any resources this StackDrawable may be holding.

Specified by:
dispose in interface StackDrawable

createTexture

private void createTexture()

getSortIndex

public long getSortIndex()
Description copied from interface: StackDrawable
Gets an index that can be used to sort this drawable.

Specified by:
getSortIndex in interface StackDrawable
Returns:
an index that can be used to sort this drawable.

draw

public void draw(javax.media.opengl.GL gl)
Description copied from interface: StackDrawable
Draws the drawable using the current OpenGL interface.

Specified by:
draw in interface StackDrawable
Parameters:
gl - the interface to OpenGL.