com.threerings.opengl.renderer.config
Class TextureConfig

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.config.ManagedConfig
          extended by com.threerings.config.ParameterizedConfig
              extended by com.threerings.opengl.renderer.config.TextureConfig
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Exportable, ResourceManager.ModificationObserver, Copyable, Cloneable

public class TextureConfig
extends ParameterizedConfig

Texture metadata.


Nested Class Summary
static class TextureConfig.Animated
          Switches between subtextures according to an expression.
static class TextureConfig.BaseDerived
          Base class of TextureConfig.BaseDerived and related implementations.
static class TextureConfig.CompareFunc
          Compare function constants.
static class TextureConfig.CompareMode
          Compare mode constants.
static class TextureConfig.CubeRender
          A dynamically rendered cube map.
static class TextureConfig.DepthMode
          Depth mode constants.
static class TextureConfig.Derived
          A derived implementation.
static class TextureConfig.Format
          Format constants.
static class TextureConfig.Frame
          A frame within an animated texture.
static class TextureConfig.Implementation
          Contains the actual implementation of the texture.
static class TextureConfig.MagFilter
          Magnification filter constants.
static class TextureConfig.MinFilter
          Minification filter constants.
static class TextureConfig.Original
          The superclass of the implementations describing an original texture, as opposed to one derived from another configuration.
static class TextureConfig.Original1D
          A 1D texture.
static class TextureConfig.Original2D
          A 2D texture.
static class TextureConfig.Original2DTarget
          A 2D texture that matches the dimensions of the render surface.
static class TextureConfig.Original3D
          A 3D texture.
static class TextureConfig.OriginalCubeMap
          A cube map texture.
static class TextureConfig.OriginalRectangle
          A 2D texture that uses the rectangle target.
static class TextureConfig.Reflection
          A planar reflection texture.
static class TextureConfig.Refraction
          A planar refraction texture.
static class TextureConfig.Shadow
          A dynamically rendered shadow map.
protected static class TextureConfig.Texture2DTarget
          A texture that automatically adjusts itself to match the dimensions of the render surface.
static class TextureConfig.Wrap
          Wrap constants.
 
Field Summary
 TextureConfig.Implementation implementation
          The actual texture implementation.
 
Fields inherited from class com.threerings.config.ParameterizedConfig
_args, _base, _derived, parameters
 
Fields inherited from class com.threerings.config.ManagedConfig
_cfgmgr, _listeners, _name, _updateConfigs, _updateResources
 
Constructor Summary
TextureConfig()
           
 
Method Summary
protected  void fireConfigUpdated()
          Fires a configuration updated event.
 Texture getFromPool(GlContext ctx)
          Returns an instance of this texture from the shared pool.
static BufferedImage getImage(GlContext ctx, String file, ColorizationConfig[] colorizations)
          Gets the requested image from the cache and applies the specified colorizations.
 Texture getTexture(GlContext ctx)
          Returns the texture corresponding to this configuration.
 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.
protected  void getUpdateReferences(ConfigReferenceSet refs)
          Collects all of the references within this config to configs that, when updated, should trigger a call to ManagedConfig.fireConfigUpdated().
protected  void getUpdateResources(HashSet<String> paths)
          Collects the paths of all resources referenced by this config that, when modified, should trigger a call to ManagedConfig.fireConfigUpdated().
 boolean isSupported(GlContext ctx, boolean fallback)
          Checks whether the texture configuration is supported.
 void returnToPool(GlContext ctx, Texture texture)
          Returns an instance of this texture to the shared pool.
 
Methods inherited from class com.threerings.config.ParameterizedConfig
applyArguments, applyArguments, getBound, getInstance, getParameter, getParameter, getReference, maybeFireOnConfigManager, validateOuters, validateReferences, wasUpdated
 
Methods inherited from class com.threerings.config.ManagedConfig
addListener, addUpdateDependencies, clearUpdateDependencies, configUpdated, getConfigManager, getInstance, getInstance, getInstance, getInstance, getName, init, removeListener, resourceModified, setName, updateFromSource
 
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

implementation

@Editable
public TextureConfig.Implementation implementation
The actual texture implementation.

Constructor Detail

TextureConfig

public TextureConfig()
Method Detail

getImage

public static BufferedImage getImage(GlContext ctx,
                                     String file,
                                     ColorizationConfig[] colorizations)
Gets the requested image from the cache and applies the specified colorizations.


isSupported

public boolean isSupported(GlContext ctx,
                           boolean fallback)
Checks whether the texture configuration is supported.


getTexture

public Texture getTexture(GlContext ctx)
Returns the texture corresponding to this configuration.


getTexture

public 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.


getFromPool

public Texture getFromPool(GlContext ctx)
Returns an instance of this texture from the shared pool.


returnToPool

public void returnToPool(GlContext ctx,
                         Texture texture)
Returns an instance of this texture to the shared pool.


fireConfigUpdated

protected void fireConfigUpdated()
Description copied from class: ManagedConfig
Fires a configuration updated event.

Overrides:
fireConfigUpdated in class ManagedConfig

getUpdateReferences

protected void getUpdateReferences(ConfigReferenceSet refs)
Description copied from class: ManagedConfig
Collects all of the references within this config to configs that, when updated, should trigger a call to ManagedConfig.fireConfigUpdated().

Overrides:
getUpdateReferences in class ManagedConfig

getUpdateResources

protected void getUpdateResources(HashSet<String> paths)
Description copied from class: ManagedConfig
Collects the paths of all resources referenced by this config that, when modified, should trigger a call to ManagedConfig.fireConfigUpdated().

Overrides:
getUpdateResources in class ManagedConfig