aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2005-11-16 19:30:45 +0000
committerChien Yang <[email protected]>2005-11-16 19:30:45 +0000
commit1efa85c8c060de3d7ff504521a9f65ad75ec257c (patch)
tree5e219e5e584d636e654672888a82bc79cb71b906 /src/classes
parent32ccd8834a41eb437e2f81ee07a84c85f6970440 (diff)
Fixed a bug in Shader support for immediate mode rendering.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@463 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes')
-rw-r--r--src/classes/share/javax/media/j3d/GraphicsContext3D.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/classes/share/javax/media/j3d/GraphicsContext3D.java b/src/classes/share/javax/media/j3d/GraphicsContext3D.java
index 34fbd8c..18e2ba8 100644
--- a/src/classes/share/javax/media/j3d/GraphicsContext3D.java
+++ b/src/classes/share/javax/media/j3d/GraphicsContext3D.java
@@ -2543,22 +2543,24 @@ public class GraphicsContext3D extends Object {
ShaderProgramRetained spR = ((ShaderAppearanceRetained)app).shaderProgram;
if ( spR != null) {
spR.updateNative(canvas3d, true);
-
- ShaderAttributeSetRetained sasR =
- ((ShaderAppearanceRetained)app).shaderAttributeSet;
+
+ ShaderAttributeSetRetained sasR =
+ ((ShaderAppearanceRetained)app).shaderAttributeSet;
if (sasR != null) {
sasR.updateNative(canvas3d, spR);
}
+ canvas3d.shaderProgram = spR;
useShaders = true;
}
- else {
- canvas3d.shaderProgram.updateNative(canvas3d, false);
- useShaders = false;
- }
}
-
+ else if (canvas3d.shaderProgram != null) {
+ canvas3d.shaderProgram.updateNative(canvas3d, false);
+ canvas3d.shaderProgram = null;
+ useShaders = false;
+ }
+
// Set the number of available texture units; this depends on
// whether or not shaders are being used.
int availableTextureUnits =