hmi.graphics.opengl.state
Class GLMaterial

java.lang.Object
  extended by hmi.graphics.opengl.state.GLMaterial
All Implemented Interfaces:
GLRenderObject, GLStateComponent

public class GLMaterial
extends Object
implements GLStateComponent

Author:
Job Zwiers

Field Summary
private  boolean alphaBlendingEnabled
           
private  FloatBuffer ambient
           
(package private)  float da
           
(package private)  float db
           
private  int destFactor
           
(package private)  float dg
           
private  FloatBuffer diffuse
           
private  GLTexture diffuseTexture
           
private  int diffuseTextureUnit
           
(package private)  float dr
           
private  FloatBuffer emission
           
private  float offsetS
           
private  float offsetT
           
private  float repeatS
           
private  float repeatT
           
private static int scid
           
private  GLShader shader
           
private  float shininess
           
private  FloatBuffer specular
           
private  int srcFactor
           
private  GLTexture transparentTexture
           
private  int transparentTextureUnit
           
private static int VEC4_SIZE
           
 
Constructor Summary
GLMaterial()
          Create an attribute.
 
Method Summary
 boolean eq(GLMaterial glm)
           
private  String fbts(FloatBuffer buf)
           
 boolean getAlphaBlendingEnabled()
           
 float getOffsetS()
          Returns the offset for the S coordinate
 float getOffsetT()
          Returns the offset for the T coordinate
 float getRepeatS()
          Returns the repeat factor for the S coordinate
 float getRepeatT()
          Returns the repeat factor for the T coordinate
 int getSCId()
          Returns the id for this type of state component
 void glInit(GLRenderContext gl)
          Required by GLRenderObject interface.
 void glRender(GLRenderContext gl)
          Required by GLRenderObject interface.
private  void init()
           
 void setAlphaBlendingEnabled(boolean mode)
           
 void setAmbientColor(float[] ambient)
           
 void setBlendDestFactor(int destFactor)
           
 void setBlendSrcFactor(int srcFactor)
           
 void setDiffuseColor(float[] diffuse)
           
 void setDiffuseTexture(GLTexture glTex, int texUnit)
           
 void setEmissionColor(float[] emission)
           
 void setGLShader(GLShader shader)
           
 void setOffsetS(float r)
          Sets the offset for the S coordinate
 void setOffsetT(float r)
          Sets the offset for the T coordinate
 void setRepeatS(float r)
          Sets the repeat factor for the S coordinate
 void setRepeatT(float r)
          Sets the repeat factor for the T coordinate
 void setShininess(float shininess)
           
 void setSpecularColor(float[] specular)
           
 void setTransparantTexture(GLTexture glTex, int texUnit)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scid

private static int scid

emission

private FloatBuffer emission

ambient

private FloatBuffer ambient

diffuse

private FloatBuffer diffuse

specular

private FloatBuffer specular

shininess

private float shininess

diffuseTexture

private GLTexture diffuseTexture

transparentTexture

private GLTexture transparentTexture

diffuseTextureUnit

private int diffuseTextureUnit

transparentTextureUnit

private int transparentTextureUnit

repeatS

private float repeatS

repeatT

private float repeatT

offsetS

private float offsetS

offsetT

private float offsetT

alphaBlendingEnabled

private boolean alphaBlendingEnabled

srcFactor

private int srcFactor

destFactor

private int destFactor

shader

private GLShader shader

VEC4_SIZE

private static final int VEC4_SIZE
See Also:
Constant Field Values

dr

float dr

dg

float dg

db

float db

da

float da
Constructor Detail

GLMaterial

public GLMaterial()
Create an attribute.

Method Detail

init

private void init()

setGLShader

public void setGLShader(GLShader shader)

getAlphaBlendingEnabled

public boolean getAlphaBlendingEnabled()

setAlphaBlendingEnabled

public void setAlphaBlendingEnabled(boolean mode)

setBlendSrcFactor

public void setBlendSrcFactor(int srcFactor)

setBlendDestFactor

public void setBlendDestFactor(int destFactor)

setEmissionColor

public void setEmissionColor(float[] emission)

setAmbientColor

public void setAmbientColor(float[] ambient)

setDiffuseColor

public void setDiffuseColor(float[] diffuse)

setSpecularColor

public void setSpecularColor(float[] specular)

setShininess

public void setShininess(float shininess)

setDiffuseTexture

public void setDiffuseTexture(GLTexture glTex,
                              int texUnit)

setTransparantTexture

public void setTransparantTexture(GLTexture glTex,
                                  int texUnit)

setRepeatS

public void setRepeatS(float r)
Sets the repeat factor for the S coordinate


getRepeatS

public float getRepeatS()
Returns the repeat factor for the S coordinate


setRepeatT

public void setRepeatT(float r)
Sets the repeat factor for the T coordinate


getRepeatT

public float getRepeatT()
Returns the repeat factor for the T coordinate


setOffsetS

public void setOffsetS(float r)
Sets the offset for the S coordinate


getOffsetS

public float getOffsetS()
Returns the offset for the S coordinate


setOffsetT

public void setOffsetT(float r)
Sets the offset for the T coordinate


getOffsetT

public float getOffsetT()
Returns the offset for the T coordinate


getSCId

public final int getSCId()
Returns the id for this type of state component

Specified by:
getSCId in interface GLStateComponent

eq

public final boolean eq(GLMaterial glm)

glInit

public final void glInit(GLRenderContext gl)
Required by GLRenderObject interface.

Specified by:
glInit in interface GLRenderObject

glRender

public final void glRender(GLRenderContext gl)
Required by GLRenderObject interface.

Specified by:
glRender in interface GLRenderObject

fbts

private String fbts(FloatBuffer buf)

toString

public String toString()
Overrides:
toString in class Object