com.threerings.opengl.renderer
Class Texture

java.lang.Object
  extended by com.threerings.opengl.renderer.Texture
Direct Known Subclasses:
Texture1D, Texture2D, Texture3D, TextureCubeMap

public abstract class Texture
extends Object

An OpenGL texture object.


Constructor Summary
Texture(Renderer renderer, int target)
          Creates a new texture for the specified renderer.
 
Method Summary
 void delete()
          Deletes this texture, rendering it unusable.
 void generateMipmap()
          Generates a set of mipmaps for this texture.
 int getDepth()
          Returns the depth of the texture.
 int getFormat()
          Returns the format of this texture.
abstract  int getHeight()
          Returns the height of the texture.
 int getId()
          Returns this texture's OpenGL identifier.
 int getTarget()
          Returns the texture's target.
abstract  int getWidth()
          Returns the width of the texture.
 boolean hasAlpha()
          Checks whether this texture has an alpha channel.
 boolean isDepth()
          Determines whether this is a depth texture.
 void setBorderColor(Color4f borderColor)
          Sets the border color.
 void setCompare(int mode, int func)
          Convenience method to set both compare parameters at once.
 void setCompareFunc(int compareFunc)
          Sets the texture compare function.
 void setCompareMode(int compareMode)
          Sets the texture compare mode.
 void setDepthMode(int depthMode)
          Sets the depth texture mode.
 void setFilters(int min, int mag)
          Convenience method to set both the filters at once.
 void setGenerateMipmaps(boolean generate)
          Sets whether or not to generate mipmaps automatically.
 void setMagFilter(int magFilter)
          Sets the texture magnification filter.
 void setMaxAnisotropy(float maxAnisotropy)
          Sets the texture maximum anisotropy.
 void setMinFilter(int minFilter)
          Sets the texture minification filter.
 void setWrap(int s, int t)
          Convenience method to set the s and t wrap modes at once.
 void setWrap(int s, int t, int r)
          Convenience method to set all the wrap modes at once.
 void setWrapR(int wrap)
          Sets the r texture wrap mode.
 void setWrapS(int wrap)
          Sets the s texture wrap mode.
 void setWrapT(int wrap)
          Sets the t texture wrap mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Texture

public Texture(Renderer renderer,
               int target)
Creates a new texture for the specified renderer.

Method Detail

getId

public final int getId()
Returns this texture's OpenGL identifier.


getTarget

public final int getTarget()
Returns the texture's target.


getFormat

public int getFormat()
Returns the format of this texture.


hasAlpha

public boolean hasAlpha()
Checks whether this texture has an alpha channel.


isDepth

public boolean isDepth()
Determines whether this is a depth texture.


getWidth

public abstract int getWidth()
Returns the width of the texture.


getHeight

public abstract int getHeight()
Returns the height of the texture.


getDepth

public int getDepth()
Returns the depth of the texture.


setFilters

public void setFilters(int min,
                       int mag)
Convenience method to set both the filters at once.


setMinFilter

public void setMinFilter(int minFilter)
Sets the texture minification filter.


setMagFilter

public void setMagFilter(int magFilter)
Sets the texture magnification filter.


setMaxAnisotropy

public void setMaxAnisotropy(float maxAnisotropy)
Sets the texture maximum anisotropy.


setWrap

public void setWrap(int s,
                    int t)
Convenience method to set the s and t wrap modes at once.


setWrap

public void setWrap(int s,
                    int t,
                    int r)
Convenience method to set all the wrap modes at once.


setWrapS

public void setWrapS(int wrap)
Sets the s texture wrap mode.


setWrapT

public void setWrapT(int wrap)
Sets the t texture wrap mode.


setWrapR

public void setWrapR(int wrap)
Sets the r texture wrap mode.


setBorderColor

public void setBorderColor(Color4f borderColor)
Sets the border color.


setGenerateMipmaps

public void setGenerateMipmaps(boolean generate)
Sets whether or not to generate mipmaps automatically.


setCompare

public void setCompare(int mode,
                       int func)
Convenience method to set both compare parameters at once.


setCompareMode

public void setCompareMode(int compareMode)
Sets the texture compare mode.


setCompareFunc

public void setCompareFunc(int compareFunc)
Sets the texture compare function.


setDepthMode

public void setDepthMode(int depthMode)
Sets the depth texture mode.


generateMipmap

public void generateMipmap()
Generates a set of mipmaps for this texture. This relies on the GL_EXT_framebuffer_object extension, so it's really only useful in conjunction with FBOs.


delete

public void delete()
Deletes this texture, rendering it unusable.



Copyright © 2011. All Rights Reserved.