codeanticode.glgraphics
Class GLModelEffectVertexAttrib

java.lang.Object
  extended by codeanticode.glgraphics.GLSLShaderAttribute
      extended by codeanticode.glgraphics.GLModelEffectVertexAttrib
All Implemented Interfaces:
GLConstants

public class GLModelEffectVertexAttrib
extends GLSLShaderAttribute

This class stores the (vertex attribute) parameter for a model effect.


Field Summary
 
Fields inherited from interface codeanticode.glgraphics.GLConstants
BACKGROUND_ALPHA, CG_CONTEXT, CG_EFFECT, CG_PROGRAM, COLOR, DOUBLE, FLOAT, FRAGMENT_PROGRAM, GEOMETRY_PROGRAM, GL_DEPTH_STENCIL, GL_DEPTH24_STENCIL8, GL_FRAME_BUFFER, GL_PIXEL_BUFFER, GL_RENDER_BUFFER, GL_TEXTURE_OBJECT, GL_UNSIGNED_INT_24_8, GL_VERTEX_BUFFER, GLGRAPHICS, GLSL_PROGRAM, GLSL_SHADER, IDENTITY_MATRIX, INVERSE_MATRIX, INVERSE_TRANSPOSE_MATRIX, LINE_ADJACENCY, LINEAR_MIPMAP_LINEAR, LINEAR_MIPMAP_NEAREST, LINEAR_SAMPLING, NEAREST_MIPMAP_LINEAR, NEAREST_MIPMAP_NEAREST, NEAREST_SAMPLING, SHADER_VAR_ARRAY, SHADER_VAR_FLOAT, SHADER_VAR_INT, SHADER_VAR_MAT2, SHADER_VAR_MAT3, SHADER_VAR_MAT4, SHADER_VAR_MODELVIEW_MAT, SHADER_VAR_MODELVIEW_PROJECTION_MAT, SHADER_VAR_PROJECTION_MAT, SHADER_VAR_TEXTURE_MAT, SHADER_VAR_TEXTURE_SAMPLER, SHADER_VAR_VEC2, SHADER_VAR_VEC3, SHADER_VAR_VEC4, TEX_BYTE, TEX_INT, TEX_NORM, TEX_ONEDIM, TEX_RECT, TRANSPOSE_MATRIX, TRIANGLE_ADJACENCY, VERTEX_PROGRAM
 
Constructor Summary
GLModelEffectVertexAttrib(processing.core.PApplet parent, GLSLShader shader, java.lang.String name, java.lang.String label, int type)
          Creates an instance of GLModelEffectParameter using the specified parameters.
GLModelEffectVertexAttrib(processing.core.PApplet parent, java.lang.String name, java.lang.String label, int type)
          Creates an instance of GLModelEffectVertexAttrib using the specified parameters.
 
Method Summary
 int getArrayLength()
          Returns array length.
 java.lang.String getLabel()
          Returns parameter label.
 java.lang.String getName()
          Returns parameter name.
 int getType()
          Returns parameter type.
static int getType(java.lang.String typeStr)
          Returns the int constant that identifies a type, given the corresponding string.
 void setShader(GLShader shader)
          Sets the shader this parameter corresponds to.
 void setValue(float value)
          Sets the parameter value when the type is float.
 void setValue(float[] value)
          Sets the parameter value for any type.
 void setValue(int value)
          Sets the parameter value when the type is int.
 void setValue(int i, float value)
          Sets the ith value for the parameter (only valid for vec or mat types).
 void setValue(int i, int j, float value)
          Sets the (ith, jth) value for the parameter (only valid for mat types).
 
Methods inherited from class codeanticode.glgraphics.GLSLShaderAttribute
available, copyToShader, disableVertexAttribArray, enableVertexAttribArray, init, setAttribArrayPointer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLModelEffectVertexAttrib

public GLModelEffectVertexAttrib(processing.core.PApplet parent,
                                 java.lang.String name,
                                 java.lang.String label,
                                 int type)
Creates an instance of GLModelEffectVertexAttrib using the specified parameters. The shader is set to null.

Parameters:
parent - PApplet
name - String
label - String
type - int

GLModelEffectVertexAttrib

public GLModelEffectVertexAttrib(processing.core.PApplet parent,
                                 GLSLShader shader,
                                 java.lang.String name,
                                 java.lang.String label,
                                 int type)
Creates an instance of GLModelEffectParameter using the specified parameters.

Parameters:
parent - PApplet
shader - GLSLShader
name - String
label - String
type - int
Method Detail

setShader

public void setShader(GLShader shader)
Sets the shader this parameter corresponds to.

Parameters:
shader - GLShader

setValue

public void setValue(int value)
Sets the parameter value when the type is int.

Parameters:
value - int

setValue

public void setValue(float value)
Sets the parameter value when the type is float.

Parameters:
value - float

setValue

public void setValue(float[] value)
Sets the parameter value for any type. When the type is int or float, the first element of the value array is considered.

Parameters:
value - float[]

setValue

public void setValue(int i,
                     float value)
Sets the ith value for the parameter (only valid for vec or mat types).

Parameters:
int - i
value - float

setValue

public void setValue(int i,
                     int j,
                     float value)
Sets the (ith, jth) value for the parameter (only valid for mat types).

Parameters:
int - i
int - j
value - float

getType

public static int getType(java.lang.String typeStr)
Returns the int constant that identifies a type, given the corresponding string.

Parameters:
String - typeStr
Returns:
int

getType

public int getType()
Returns parameter type.

Returns:
int

getName

public java.lang.String getName()
Returns parameter name.

Returns:
String

getLabel

public java.lang.String getLabel()
Returns parameter label.

Returns:
String

getArrayLength

public int getArrayLength()
Returns array length.

Returns:
String


processing library GLGraphics by Andres Colubri. (c) 2008-2011