summaryrefslogtreecommitdiffstats
path: root/src/net/java/joglutils/msg/nodes/TextureCoordinate2.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-03-18 23:30:00 +0000
committerKenneth Russel <[email protected]>2007-03-18 23:30:00 +0000
commit44ded763ea870d0daad90a0f7355a5792b16b774 (patch)
tree1d8ff1f40e46793f0e9856d10e7e2cfc3c366da2 /src/net/java/joglutils/msg/nodes/TextureCoordinate2.java
parente1f4a731f55ab29e3f23f87102af1b11c67cb0da (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/TextureCoordinate2.java')
-rw-r--r--src/net/java/joglutils/msg/nodes/TextureCoordinate2.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/java/joglutils/msg/nodes/TextureCoordinate2.java b/src/net/java/joglutils/msg/nodes/TextureCoordinate2.java
index ed4ecf8..f7720d2 100644
--- a/src/net/java/joglutils/msg/nodes/TextureCoordinate2.java
+++ b/src/net/java/joglutils/msg/nodes/TextureCoordinate2.java
@@ -39,6 +39,7 @@ package net.java.joglutils.msg.nodes;
import net.java.joglutils.msg.actions.*;
import net.java.joglutils.msg.collections.*;
+import net.java.joglutils.msg.elements.*;
/** Represents a set of 2-dimensional texture coordinates which can be
used to texture geometric shapes. */
@@ -46,6 +47,11 @@ import net.java.joglutils.msg.collections.*;
public class TextureCoordinate2 extends Node {
private Vec2fCollection data;
+ static {
+ // Enable the elements this node affects for known actions
+ GLTextureCoordinateElement.enable(GLRenderAction.getDefaultState());
+ }
+
/** Sets the texture coordinate data in this node. */
public void setData(Vec2fCollection data) {
this.data = data;
@@ -57,6 +63,8 @@ public class TextureCoordinate2 extends Node {
}
public void doAction(Action action) {
- action.visit(this);
+ if (TextureCoordinateElement.isEnabled(action.getState())) {
+ TextureCoordinateElement.set(action.getState(), getData().getData());
+ }
}
}