diff options
author | Kenneth Russel <[email protected]> | 2007-03-18 23:30:00 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2007-03-18 23:30:00 +0000 |
commit | 44ded763ea870d0daad90a0f7355a5792b16b774 (patch) | |
tree | 1d8ff1f40e46793f0e9856d10e7e2cfc3c366da2 /src/net/java/joglutils/msg/nodes/Blend.java | |
parent | e1f4a731f55ab29e3f23f87102af1b11c67cb0da (diff) |
Added extensible action method mechanism via ActionTable, decoupling
Action implementations from the set of Nodes in the library.
Refactored OpenGL rendering into node instances to potentially share
more code among different Action subclasses.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@45 83d24430-9974-4f80-8418-2cc3294053b9
Diffstat (limited to 'src/net/java/joglutils/msg/nodes/Blend.java')
-rw-r--r-- | src/net/java/joglutils/msg/nodes/Blend.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/net/java/joglutils/msg/nodes/Blend.java b/src/net/java/joglutils/msg/nodes/Blend.java index 18cd5a6..af95e00 100644 --- a/src/net/java/joglutils/msg/nodes/Blend.java +++ b/src/net/java/joglutils/msg/nodes/Blend.java @@ -38,6 +38,7 @@ package net.java.joglutils.msg.nodes; import net.java.joglutils.msg.actions.*; +import net.java.joglutils.msg.elements.*; import net.java.joglutils.msg.math.*; /** Provides control over OpenGL blending modes. */ @@ -49,6 +50,11 @@ public class Blend extends Node { private int destFunc = ZERO; private int blendEquation = FUNC_ADD; + static { + // Enable the elements this node affects for known actions + GLBlendElement.enable(GLRenderAction.getDefaultState()); + } + /** One of the blend functions. See the OpenGL documentation for glBlendFunc for more details. */ public static final int ZERO = 1; /** One of the blend functions. See the OpenGL documentation for glBlendFunc for more details. */ @@ -163,6 +169,13 @@ public class Blend extends Node { } public void doAction(Action action) { - action.visit(this); + if (BlendElement.isEnabled(action.getState())) { + BlendElement.set(action.getState(), + getEnabled(), + getBlendColor(), + getSourceFunc(), + getDestFunc(), + getBlendEquation()); + } } } |