diff options
author | phil <[email protected]> | 2016-10-31 14:16:02 +1300 |
---|---|---|
committer | phil <[email protected]> | 2016-10-31 14:16:02 +1300 |
commit | f8a6e9c5ccf218442420633346e89b83a8ce3a64 (patch) | |
tree | 43a0caae6fa7bae6b4521ac07ee04053507a392b | |
parent | 35fbce47913919c4534e91fc29b3d620e347ca1a (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
-rw-r--r-- | src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java | 3 | ||||
-rw-r--r-- | src/main/java/org/jogamp/java3d/MasterControl.java | 22 |
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, |