aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java10
-rw-r--r--src/classes/share/javax/media/j3d/Renderer.java6
2 files changed, 11 insertions, 5 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index 44a6c02..f57afc9 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -449,7 +449,7 @@ public class Canvas3D extends Canvas {
boolean sceneAntialiasingMultiSamplesAvailable;
// Use to see whether antialiasing is already set
- boolean antialiasingSet = false;
+ private boolean antialiasingSet = false;
//
// Read-only flag that indicates the size of the texture color
@@ -2382,6 +2382,9 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
this.offScreen);
// compute the max available texture units
maxAvailableTextureUnits = Math.max(maxTextureUnits, maxTextureImageUnits);
+ // reset 'antialiasingSet' if new context is created for an already existing Canvas3D,
+ // e.g. resizing offscreen Canvas3D
+ antialiasingSet = false;
return retVal;
}
@@ -4705,9 +4708,14 @@ void swapBuffers(Context ctx, Drawable drawable) {
Pipeline.getPipeline().setFogEnableFlag(ctx, enableFlag);
}
+boolean isAntialiasingSet() {
+ return antialiasingSet;
+}
+
// Setup the full scene antialising in D3D and ogl when GL_ARB_multisamle supported
void setFullSceneAntialiasing(Context ctx, boolean enable) {
Pipeline.getPipeline().setFullSceneAntialiasing(ctx, enable);
+ antialiasingSet = enable;
}
void setGlobalAlpha(Context ctx, float alpha) {
diff --git a/src/classes/share/javax/media/j3d/Renderer.java b/src/classes/share/javax/media/j3d/Renderer.java
index 8007c36..1e1f0d1 100644
--- a/src/classes/share/javax/media/j3d/Renderer.java
+++ b/src/classes/share/javax/media/j3d/Renderer.java
@@ -1109,19 +1109,17 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
}
} else {
- if (!canvas.antialiasingSet) {
+ if (!canvas.isAntialiasingSet()) {
// System.err.println("Renderer : Enable FullSceneAntialiasing");
canvas.setFullSceneAntialiasing(canvas.ctx, true);
- canvas.antialiasingSet = true;
}
}
} else {
- if (canvas.antialiasingSet) {
+ if (canvas.isAntialiasingSet()) {
// System.err.println("Renderer : Disable SceneAntialiasing");
canvas.setFullSceneAntialiasing(canvas.ctx, false);
- canvas.antialiasingSet = false;
}
}