aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-08 03:19:41 +0200
committerSven Gothel <[email protected]>2011-10-08 03:19:41 +0200
commit0c138d5410ed32bdeef22052b57f1bcecf6b5d4f (patch)
tree55707ace5fa46d3c97f621e5bdcca1c380991b4b /src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
parent727c697f6808caec2fcbcc35d155552590d4f869 (diff)
Generalize sample extension in GLCapabilities*, currently NV_coverage_sample is respected in EGL
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
index 0ad97c3bf..803a47c34 100644
--- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -127,6 +127,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
final int OPAQUE_MISMATCH_PENALTY = 750;
final int STENCIL_MISMATCH_PENALTY = 500;
final int MULTISAMPLE_MISMATCH_PENALTY = 500;
+ final int MULTISAMPLE_EXTENSION_MISMATCH_PENALTY = 250; // just a little drop, no scale
// Pseudo attempt to keep equal rank penalties scale-equivalent
// (e.g., stencil mismatch is 3 * accum because there are 3 accum
// components)
@@ -140,6 +141,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
scores[i] = NO_SCORE;
}
final int gldes_samples = gldes.getSampleBuffers() ? gldes.getNumSamples() : 0;
+ final boolean gldes_defaultSampleExt = gldes.getSampleExtension().equals(GLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION);
// Compute score for each
for (int i = 0; i < availnum; i++) {
@@ -187,8 +189,13 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
if ((gldes.getStencilBits() > 0) && (cur.getStencilBits() == 0)) {
score += sign(score) * STENCIL_MISMATCH_PENALTY;
}
- if ((gldes_samples > 0) && (cur_samples == 0)) {
- score += sign(score) * MULTISAMPLE_MISMATCH_PENALTY;
+ if (gldes_samples > 0) {
+ if (cur_samples == 0) {
+ score += sign(score) * MULTISAMPLE_MISMATCH_PENALTY;
+ }
+ if (!gldes_defaultSampleExt && !gldes.getSampleExtension().equals(cur.getSampleExtension())) {
+ score += sign(score) * MULTISAMPLE_EXTENSION_MISMATCH_PENALTY;
+ }
}
scores[i] = score;
}