aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-02-16 14:55:24 -0800
committerHarvey Harrison <[email protected]>2013-02-16 21:51:07 -0800
commit44c95d7be5a78e7c2e4e2b127f4c6df02c7dab57 (patch)
tree979229337f08ece2c2bcfeb8a9bacd07d2bf5ed0 /src/classes
parent7058f2152dbd4e78526217fe4869e1392fef44c2 (diff)
j3dcore: make the antialiasing flag private to Canvas3d
Includes fix for resetting the antiAliasing flag from a patch by August Lammersdorf. Signed-off-by: August Lammersdorf <[email protected]> Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes')
-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;
}
}