subscript.vis
Class Texture

java.lang.Object
  extended by subscript.vis.Texture

public class Texture
extends java.lang.Object

Wrapper for OpenGL textures.


Constructor Summary
Texture(java.awt.image.BufferedImage im)
           
Texture(java.awt.image.BufferedImage im, int width, int height)
           
Texture(java.lang.String path)
          Create a new texture.
Texture(java.lang.String path, int width, int height)
          Create a new texture.
 
Method Summary
 void bind(javax.media.opengl.GLAutoDrawable gldrawable, javax.media.opengl.GL gl)
          Called to indicate that subsequent rendering should use this texture.
 int getHeight()
           
 int getWidth()
           
 int init(javax.media.opengl.GLAutoDrawable gldrawable)
          Called internally to register this texture with a new GL context.
 void setFiltering(boolean v)
           
 void setup(javax.media.opengl.GLAutoDrawable gldrawable, javax.media.opengl.GL gl)
           
 void unbind(javax.media.opengl.GLAutoDrawable gldrawable, javax.media.opengl.GL gl)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Texture

public Texture(java.lang.String path,
               int width,
               int height)
        throws java.io.IOException
Create a new texture.

Parameters:
path - Pathname to a picture which is 2^n X 2^m pixels.
Throws:
java.io.IOException

Texture

public Texture(java.awt.image.BufferedImage im,
               int width,
               int height)

Texture

public Texture(java.awt.image.BufferedImage im)

Texture

public Texture(java.lang.String path)
        throws java.io.IOException
Create a new texture.

Parameters:
path - Pathname to a picture which is 2^n X 2^m pixels.
Throws:
java.io.IOException
Method Detail

setFiltering

public void setFiltering(boolean v)

getWidth

public int getWidth()

getHeight

public int getHeight()

init

public int init(javax.media.opengl.GLAutoDrawable gldrawable)
Called internally to register this texture with a new GL context.


setup

public void setup(javax.media.opengl.GLAutoDrawable gldrawable,
                  javax.media.opengl.GL gl)

bind

public void bind(javax.media.opengl.GLAutoDrawable gldrawable,
                 javax.media.opengl.GL gl)
Called to indicate that subsequent rendering should use this texture. If the GL context is new, the texture will be initialized automatically. Otherwise, the last used texture ID will be recycled.


unbind

public void unbind(javax.media.opengl.GLAutoDrawable gldrawable,
                   javax.media.opengl.GL gl)