org.xith3d.loaders.shaders.impl.glsl
Class GLSLShaderLoader.InlineVariableMapping

java.lang.Object
  extended by org.xith3d.loaders.shaders.impl.glsl.GLSLShaderLoader.InlineVariableMapping
Enclosing class:
GLSLShaderLoader

public static final class GLSLShaderLoader.InlineVariableMapping
extends java.lang.Object

This defines a mapping for placeholders in a shader source, that are replaced by the provided values. The value is converted to a String through the toString() method.


Constructor Summary
GLSLShaderLoader.InlineVariableMapping(java.lang.String variableName, java.lang.Object value)
          Creates a new mapping.
 
Method Summary
 java.lang.String getSearchString()
          Returns ${variableName}.
 java.lang.Object getValue()
          Returns the raw value.
 java.lang.String getValueAsString()
          Returns the value converted to a String.
 java.lang.String getVariableName()
          Returns the variable name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLSLShaderLoader.InlineVariableMapping

public GLSLShaderLoader.InlineVariableMapping(java.lang.String variableName,
                                              java.lang.Object value)
Creates a new mapping.

Parameters:
variableName - the name of the variabled as noted in the shader source. If this name is e.g. MY_VARIABLE, it is searched for as ${MY_VARIABLE}. Hence you must never use ${} for this name at this place.
value - the raw value, which is converted to a String through the toString() method.
Method Detail

getVariableName

public final java.lang.String getVariableName()
Returns the variable name.

Returns:
the variable name.

getSearchString

public final java.lang.String getSearchString()
Returns ${variableName}.

Returns:
${variableName}.

getValue

public final java.lang.Object getValue()
Returns the raw value.

Returns:
the raw value.

getValueAsString

public final java.lang.String getValueAsString()
Returns the value converted to a String.

Returns:
the value converted to a String.