aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorphil <philjord@ihug.co.nz>2016-10-31 14:16:02 +1300
committerphil <philjord@ihug.co.nz>2016-10-31 14:16:02 +1300
commitf8a6e9c5ccf218442420633346e89b83a8ce3a64 (patch)
tree43a0caae6fa7bae6b4521ac07ee04053507a392b /src/main/java
parent35fbce47913919c4534e91fc29b3d620e347ca1a (diff)
j3dcore: add handling for the new j3d.numSamples property
Override the number of canvas samples using a new Integer property, add a helper to MasterControl similar to the existing Boolean property method
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java3
-rw-r--r--src/main/java/org/jogamp/java3d/MasterControl.java22
2 files changed, 24 insertions, 1 deletions
diff --git a/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java b/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java
index 3c97cd5..f39d5e6 100644
--- a/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java
+++ b/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java
@@ -8529,7 +8529,8 @@ class Jogl2es2Pipeline extends Jogl2es2DEPPipeline
if (gct.getSceneAntialiasing() != GraphicsConfigTemplate.UNNECESSARY && gct.getDoubleBuffer() != GraphicsConfigTemplate.UNNECESSARY)
{
caps.setSampleBuffers(true);
- caps.setNumSamples(2);
+ int numSamples = MasterControl.getIntegerProperty("j3d.numSamples", 2);
+ caps.setNumSamples(numSamples);
}
else
{
diff --git a/src/main/java/org/jogamp/java3d/MasterControl.java b/src/main/java/org/jogamp/java3d/MasterControl.java
index ef50d81..3b7c5ac 100644
--- a/src/main/java/org/jogamp/java3d/MasterControl.java
+++ b/src/main/java/org/jogamp/java3d/MasterControl.java
@@ -788,6 +788,28 @@ private static String getProperty(final String prop) {
});
}
+ static int getIntegerProperty(String prop, int defaultValue)
+ {
+ int value = defaultValue;
+ String propValue = getProperty(prop);
+
+ if (propValue != null)
+ {
+ try
+ {
+ value = Integer.parseInt(propValue);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+ if (J3dDebug.debug)
+ System.err.println("Java 3D: " + prop + "=" + value);
+
+ return value;
+ }
+
+
static boolean getBooleanProperty(String prop,
boolean defaultValue,
String trueMsg,