summaryrefslogtreecommitdiffstats
path: root/src/demos/multisample/Multisample.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-01-31 17:04:41 +0100
committerSven Gothel <[email protected]>2011-01-31 17:04:41 +0100
commit8e5c4d5e23696ce46d4d4fd7ff28d987d7da20a4 (patch)
treefd8cad41d9a1362e995a887e36f94df6c44492eb /src/demos/multisample/Multisample.java
parente35038cc3c01b6ad8beb559986102c68fde614b6 (diff)
Adapt CapabilitiesChooser.chooseCapabilities() changes of JOGL 8adc04788a6d9dd44de5a4636b46d14dbb70b799
Diffstat (limited to 'src/demos/multisample/Multisample.java')
-rwxr-xr-xsrc/demos/multisample/Multisample.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/demos/multisample/Multisample.java b/src/demos/multisample/Multisample.java
index 9c95b97..5b5d6b2 100755
--- a/src/demos/multisample/Multisample.java
+++ b/src/demos/multisample/Multisample.java
@@ -39,6 +39,7 @@
package demos.multisample;
+import java.util.List;
import java.awt.*;
import java.awt.event.*;
import javax.media.opengl.*;
@@ -50,11 +51,11 @@ public class Multisample {
// Simple class to warn if results are not going to be as expected
static class MultisampleChooser extends DefaultGLCapabilitiesChooser {
public int chooseCapabilities(GLCapabilities desired,
- GLCapabilities[] available,
+ List/*<GLCapabilitiesImmutable>*/ available,
int windowSystemRecommendedChoice) {
boolean anyHaveSampleBuffers = false;
- for (int i = 0; i < available.length; i++) {
- GLCapabilities caps = available[i];
+ for (int i = 0; i < available.size(); i++) {
+ GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
if (caps != null && caps.getSampleBuffers()) {
anyHaveSampleBuffers = true;
break;
@@ -63,8 +64,9 @@ public class Multisample {
int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
if (!anyHaveSampleBuffers) {
System.err.println("WARNING: antialiasing will be disabled because none of the available pixel formats had it to offer");
- } else {
- if (!available[selection].getSampleBuffers()) {
+ } else if(selection>=0) {
+ GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(selection);
+ if (!caps.getSampleBuffers()) {
System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
}
}