diff options
author | Christopher Campbell <[email protected]> | 2007-04-04 07:49:21 +0000 |
---|---|---|
committer | Christopher Campbell <[email protected]> | 2007-04-04 07:49:21 +0000 |
commit | 316004096ddb50ab79a3e9a1ae193fa75f8a157e (patch) | |
tree | 4599a195daa6277bd9be6ac3462ccb19ab51b716 /src/net/java/joglutils/msg/elements/GLShaderElement.java | |
parent | ff22ba17c2356f3fc66f41c52c27e9deaba02dd2 (diff) |
Hacked in support for setUniform() in ShaderNode. When I say hack, I mean it. Will clean it up later.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@58 83d24430-9974-4f80-8418-2cc3294053b9
Diffstat (limited to 'src/net/java/joglutils/msg/elements/GLShaderElement.java')
-rw-r--r-- | src/net/java/joglutils/msg/elements/GLShaderElement.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/net/java/joglutils/msg/elements/GLShaderElement.java b/src/net/java/joglutils/msg/elements/GLShaderElement.java index a7abbc6..cf28c97 100644 --- a/src/net/java/joglutils/msg/elements/GLShaderElement.java +++ b/src/net/java/joglutils/msg/elements/GLShaderElement.java @@ -36,9 +36,12 @@ package net.java.joglutils.msg.elements; +import java.util.*; + import javax.media.opengl.*; import javax.media.opengl.glu.*; +import net.java.joglutils.msg.math.*; import net.java.joglutils.msg.misc.*; import net.java.joglutils.msg.nodes.*; @@ -87,6 +90,17 @@ public class GLShaderElement extends ShaderElement { } if (curShader != null) { curShader.enable(); + + // FIXME: the following is a big hack... + Map<String, Vec4f> fMap = shader.getUniformfMap(); + if (!fMap.isEmpty()) { + for (String name : fMap.keySet()) { + Vec4f val = fMap.get(name); + //curShader.setUniform(name, val.x(), val.y(), val.z(), val.w()); + curShader.setUniform(name, val.x()); + fMap.clear(); + } + } } } } |