aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Puybaret <[email protected]>2020-01-25 18:28:54 +1300
committerPhilip Jordan <[email protected]>2020-01-25 18:28:54 +1300
commit239b497e3c012bfee176192cd344bbeb0c3cf192 (patch)
treeecc01d60293bff66875f33afb2206ac8b710e7ff
parentc05f0d55e448af9d956cae051cfffdbf2053677d (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.
-rw-r--r--src/main/java/org/jogamp/java3d/JoglPipeline.java3
-rw-r--r--src/main/java/org/jogamp/java3d/MasterControl.java13
2 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/org/jogamp/java3d/JoglPipeline.java b/src/main/java/org/jogamp/java3d/JoglPipeline.java
index 0b727a6..9f19ef6 100644
--- a/src/main/java/org/jogamp/java3d/JoglPipeline.java
+++ b/src/main/java/org/jogamp/java3d/JoglPipeline.java
@@ -8373,7 +8373,8 @@ static boolean hasFBObjectSizeChanged(JoglDrawable jdraw, int width, int height)
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 {
caps.setSampleBuffers(false);
caps.setNumSamples(0);
diff --git a/src/main/java/org/jogamp/java3d/MasterControl.java b/src/main/java/org/jogamp/java3d/MasterControl.java
index a7495cf..2d4f573 100644
--- a/src/main/java/org/jogamp/java3d/MasterControl.java
+++ b/src/main/java/org/jogamp/java3d/MasterControl.java
@@ -806,20 +806,15 @@ private static String getProperty(final String prop) {
});
}
- static int getIntegerProperty(String prop, int defaultValue)
- {
+ static int getIntegerProperty(String prop, int defaultValue) {
int value = defaultValue;
String propValue = getProperty(prop);
- if (propValue != null)
- {
- try
- {
+ if (propValue != null) {
+ try {
value = Integer.parseInt(propValue);
}
- catch (NumberFormatException e)
- {
- }
+ catch (NumberFormatException e) { }
}
if (J3dDebug.debug)
System.err.println("Java 3D: " + prop + "=" + value);