diff options
author | Emmanuel Puybaret <puybaret@eteks.com> | 2016-10-30 12:58:43 -0700 |
---|---|---|
committer | Harvey Harrison <harvey.harrison@gmail.com> | 2016-10-30 12:58:43 -0700 |
commit | dfad04062e389254f80517ce8a9efca79eb40856 (patch) | |
tree | 98943a2d5a3540479bea9c85d5949d5124eff191 /src/javax/media/j3d/MasterControl.java | |
parent | 7370d962f8945ac8c3b36bb005d8d0a7f50656c5 (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 methods.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Diffstat (limited to 'src/javax/media/j3d/MasterControl.java')
-rw-r--r-- | src/javax/media/j3d/MasterControl.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/javax/media/j3d/MasterControl.java b/src/javax/media/j3d/MasterControl.java index c63dfd9..0bf27ab 100644 --- a/src/javax/media/j3d/MasterControl.java +++ b/src/javax/media/j3d/MasterControl.java @@ -779,6 +779,22 @@ 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, |