com.threerings.opengl.renderer.config
Class TextureConfig.Original

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.renderer.config.TextureConfig.Implementation
          extended by com.threerings.opengl.renderer.config.TextureConfig.Original
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Direct Known Subclasses:
TextureConfig.Original1D, TextureConfig.Original2D, TextureConfig.Original2DTarget, TextureConfig.Original3D, TextureConfig.OriginalCubeMap
Enclosing class:
TextureConfig

public abstract static class TextureConfig.Original
extends TextureConfig.Implementation

The superclass of the implementations describing an original texture, as opposed to one derived from another configuration.


Field Summary
protected  List<SoftReference<Texture>> _pool
          The pool of unique texture instances.
protected  SoftReference<Texture> _texture
          The texture corresponding to this configuration.
 boolean border
          Whether or not the texture has a border.
 Color4f borderColor
          The border color.
 TextureConfig.CompareFunc compareFunc
          The texture compare function.
 TextureConfig.CompareMode compareMode
          The texture compare mode.
 TextureConfig.DepthMode depthMode
          The depth texture mode.
 TextureConfig.Format format
          The texture format.
 String identity
          Used to create separate instances of the same configuration.
 TextureConfig.MagFilter magFilter
          The magnification filter.
 float maxAnisotropy
          The maximum degree of anisotropy.
 TextureConfig.MinFilter minFilter
          The minification filter.
 TextureConfig.Wrap wrapR
          The r wrap mode.
 TextureConfig.Wrap wrapS
          The s wrap mode.
 TextureConfig.Wrap wrapT
          The t wrap mode.
 
Constructor Summary
TextureConfig.Original()
           
 
Method Summary
protected  void configureTexture(Texture texture)
          Configures the supplied texture with this config's parameters.
protected abstract  Texture createTexture(GlContext ctx)
          Creates the texture for this configuration.
 Texture getFromPool(GlContext ctx)
          Fetches a texture from the shared pool, or returns null if the implementation doesn't contain a pool.
protected  List<SoftReference<Texture>> getPool()
          Returns a reference to the (lazily created) texture pool.
 Texture getTexture(GlContext ctx, TextureState state, TextureUnit unit, Scope scope, List<Dependency.Adder> adders, List<Updater> updaters)
          Returns the (possibly dynamic) texture corresponding to this configuration.
 void invalidate()
          Invalidates any cached data.
 boolean isSupported(GlContext ctx, boolean fallback)
          Determines whether this configuration is supported by the hardware.
 void returnToPool(GlContext ctx, Texture texture)
          Returns a texture to the shared pool.
 
Methods inherited from class com.threerings.opengl.renderer.config.TextureConfig.Implementation
getTexture, getUpdateReferences, getUpdateResources
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

format

@Editable(category="data")
public TextureConfig.Format format
The texture format.


identity

@Editable(category="data")
public String identity
Used to create separate instances of the same configuration.


minFilter

@Editable(category="filter",
          hgroup="f")
public TextureConfig.MinFilter minFilter
The minification filter.


magFilter

@Editable(category="filter",
          hgroup="f")
public TextureConfig.MagFilter magFilter
The magnification filter.


maxAnisotropy

@Editable(min=1.0,
          step=0.01,
          category="filter")
public float maxAnisotropy
The maximum degree of anisotropy.


wrapS

@Editable(category="wrap",
          hgroup="w")
public TextureConfig.Wrap wrapS
The s wrap mode.


wrapT

@Editable(category="wrap",
          hgroup="w")
public TextureConfig.Wrap wrapT
The t wrap mode.


wrapR

@Editable(category="wrap",
          hgroup="w")
public TextureConfig.Wrap wrapR
The r wrap mode.


border

@Editable(category="wrap",
          hgroup="b")
public boolean border
Whether or not the texture has a border.


borderColor

@Editable(mode="alpha",
          category="wrap",
          hgroup="b")
public Color4f borderColor
The border color.


compareMode

@Editable(category="compare",
          hgroup="c")
public TextureConfig.CompareMode compareMode
The texture compare mode.


compareFunc

@Editable(category="compare",
          hgroup="c")
public TextureConfig.CompareFunc compareFunc
The texture compare function.


depthMode

@Editable(category="compare")
public TextureConfig.DepthMode depthMode
The depth texture mode.


_texture

@DeepOmit
protected transient SoftReference<Texture> _texture
The texture corresponding to this configuration.


_pool

@DeepOmit
protected transient List<SoftReference<Texture>> _pool
The pool of unique texture instances.

Constructor Detail

TextureConfig.Original

public TextureConfig.Original()
Method Detail

isSupported

public boolean isSupported(GlContext ctx,
                           boolean fallback)
Description copied from class: TextureConfig.Implementation
Determines whether this configuration is supported by the hardware.

Specified by:
isSupported in class TextureConfig.Implementation

getTexture

public Texture getTexture(GlContext ctx,
                          TextureState state,
                          TextureUnit unit,
                          Scope scope,
                          List<Dependency.Adder> adders,
                          List<Updater> updaters)
Description copied from class: TextureConfig.Implementation
Returns the (possibly dynamic) texture corresponding to this configuration.

Specified by:
getTexture in class TextureConfig.Implementation

getFromPool

public Texture getFromPool(GlContext ctx)
Description copied from class: TextureConfig.Implementation
Fetches a texture from the shared pool, or returns null if the implementation doesn't contain a pool.

Overrides:
getFromPool in class TextureConfig.Implementation

returnToPool

public void returnToPool(GlContext ctx,
                         Texture texture)
Description copied from class: TextureConfig.Implementation
Returns a texture to the shared pool.

Overrides:
returnToPool in class TextureConfig.Implementation

invalidate

public void invalidate()
Description copied from class: TextureConfig.Implementation
Invalidates any cached data.

Overrides:
invalidate in class TextureConfig.Implementation

createTexture

protected abstract Texture createTexture(GlContext ctx)
Creates the texture for this configuration.


configureTexture

protected void configureTexture(Texture texture)
Configures the supplied texture with this config's parameters.


getPool

protected List<SoftReference<Texture>> getPool()
Returns a reference to the (lazily created) texture pool.