net.java.joglutils.msg.elements
Class BlendElement

java.lang.Object
  extended by net.java.joglutils.msg.elements.Element
      extended by net.java.joglutils.msg.elements.BlendElement
Direct Known Subclasses:
GLBlendElement

public class BlendElement
extends Element

Represents the blending state of the OpenGL fixed-function pipeline.


Field Summary
protected  Vec4f blendColor
           
protected  int blendEquation
           
protected  int destFunc
           
protected  boolean enabled
           
protected  int srcFunc
           
 
Constructor Summary
BlendElement()
           
 
Method Summary
static void enable(State defaultState)
          Enables this element in the passed state, which should be the default for a given action.
static Vec4f getBlendColor(State state)
          Returns the blending color.
static int getBlendEquation(State state)
          Returns the blending equation.
static int getDestFunc(State state)
          Returns the destination function for blending.
static boolean getEnabled(State state)
          Returns whether blending is enabled.
static BlendElement getInstance(State state)
          Returns the instance of this element in the passed State.
static int getSourceFunc(State state)
          Returns the source function for blending.
 StateIndex getStateIndex()
          All concrete element subclasses must register themselves with the State in order to reserve a slot, or index, in the state.
static boolean isEnabled(State state)
          Indicates whether this element is enabled in the given default state for a particular action.
 Element newInstance()
          Creates a new instance initialized to the default values for the state element.
 void push(State state)
          Pushes the element, allowing for side effects to occur.
static void set(State state, boolean enabled, Vec4f blendColor, int srcFunc, int destFunc, int blendEquation)
          Sets all of the portions of the blending state in the passed State object.
 void setElt(boolean enabled, Vec4f blendColor, int srcFunc, int destFunc, int blendEquation)
          Sets all of the portions of the blending state in this element.
 
Methods inherited from class net.java.joglutils.msg.elements.Element
getDepth, getNext, getNextInStack, pop, setDepth, setNext, setNextInStack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled

blendColor

protected Vec4f blendColor

srcFunc

protected int srcFunc

destFunc

protected int destFunc

blendEquation

protected int blendEquation
Constructor Detail

BlendElement

public BlendElement()
Method Detail

getStateIndex

public StateIndex getStateIndex()
Description copied from class: Element
All concrete element subclasses must register themselves with the State in order to reserve a slot, or index, in the state. This method must be overridden to return this slot.

Specified by:
getStateIndex in class Element

newInstance

public Element newInstance()
Description copied from class: Element
Creates a new instance initialized to the default values for the state element. All concrete Element subclasses must implement this operation.

Specified by:
newInstance in class Element

getInstance

public static BlendElement getInstance(State state)
Returns the instance of this element in the passed State.


enable

public static void enable(State defaultState)
Enables this element in the passed state, which should be the default for a given action.


isEnabled

public static boolean isEnabled(State state)
Indicates whether this element is enabled in the given default state for a particular action.


set

public static void set(State state,
                       boolean enabled,
                       Vec4f blendColor,
                       int srcFunc,
                       int destFunc,
                       int blendEquation)
Sets all of the portions of the blending state in the passed State object.


getEnabled

public static boolean getEnabled(State state)
Returns whether blending is enabled.


getBlendColor

public static Vec4f getBlendColor(State state)
Returns the blending color.


getSourceFunc

public static int getSourceFunc(State state)
Returns the source function for blending.


getDestFunc

public static int getDestFunc(State state)
Returns the destination function for blending.


getBlendEquation

public static int getBlendEquation(State state)
Returns the blending equation.


push

public void push(State state)
Description copied from class: Element
Pushes the element, allowing for side effects to occur. Default method does nothing.

Overrides:
push in class Element

setElt

public void setElt(boolean enabled,
                   Vec4f blendColor,
                   int srcFunc,
                   int destFunc,
                   int blendEquation)
Sets all of the portions of the blending state in this element.