aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-01-31 07:42:43 +0100
committerSven Gothel <[email protected]>2011-01-31 07:42:43 +0100
commit8adc04788a6d9dd44de5a4636b46d14dbb70b799 (patch)
tree50f63e6d9b7a22d6bb122f34e59a22e546261309 /src/test/com/jogamp/opengl
parent02d5240ccac8875144e5f37c2a4d09375338adc2 (diff)
GLCapabilities enhancements: Choosing, All-Available, Data Handling (X11, WGL and EGL)
- GLDrawableFactory exposes: public final List/*GLCapabilitiesImmutable*/ getAvailableCapabilities(AbstractGraphicsDevice device) - GLCapabilities platform specialization containing native ids (XVisual/FBConfig, PFD, EGLConfig, ..) - GLCapabilities setPbuffer(true) disables onscreen - Capabilities setOnscreen(true) disables pbuffer - Capabilities implements Comparable - *Capabilities: enhanced 'toString(..)' - CapabilitiesChooser.chooseCapabilities: 'CapabilitiesImmutable[] available' -> 'List /*<CapabilitiesImmutable>*/ available' - VersionApplet, GLCanvas.main, GLWindow.main, GLProfile/debug: dumps all available GLCaps - WGLGLCapabilities: proper non-displayeble (pbuffer) pfdid handling TODO: ES/EGL test with emulation
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java23
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java12
2 files changed, 22 insertions, 13 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
index 88caed357..13af808c0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
@@ -28,21 +28,22 @@
package com.jogamp.opengl.test.junit.jogl.acore;
-import com.jogamp.common.GlueGenVersion;
-import com.jogamp.common.util.VersionUtil;
-import com.jogamp.nativewindow.NativeWindowVersion;
-import com.jogamp.opengl.test.junit.util.UITestCase;
-import com.jogamp.opengl.test.junit.util.DumpGLInfo;
+import java.io.IOException;
+import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import javax.media.opengl.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.*;
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.nativewindow.NativeWindowVersion;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.DumpGLInfo;
import com.jogamp.opengl.JoglVersion;
-import java.io.IOException;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.*;
public class TestGLProfile01NEWT extends UITestCase {
@@ -53,6 +54,12 @@ public class TestGLProfile01NEWT extends UITestCase {
System.err.println(NativeWindowVersion.getInstance());
System.err.println(JoglVersion.getInstance());
System.err.println(NewtVersion.getInstance());
+
+ GLDrawableFactory factory = GLDrawableFactory.getFactory(GLProfile.getDefault());
+ List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null);
+ for(int i=0; i<availCaps.size(); i++) {
+ System.err.println(availCaps.get(i));
+ }
}
@Test
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
index 9653038d1..c2182b8b7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
@@ -39,16 +39,17 @@
*/
package com.jogamp.opengl.test.junit.jogl.caps;
+import java.util.List;
import javax.media.opengl.DefaultGLCapabilitiesChooser;
import javax.media.opengl.GLCapabilitiesImmutable;
class MultisampleChooser01 extends DefaultGLCapabilitiesChooser {
- public int chooseCapabilities(GLCapabilitiesImmutable desired, GLCapabilitiesImmutable[] available, int windowSystemRecommendedChoice) {
+ public int chooseCapabilities(GLCapabilitiesImmutable desired, List/*<GLCapabilitiesImmutable>*/ available, int windowSystemRecommendedChoice) {
boolean anyHaveSampleBuffers = false;
- for (int i = 0; i < available.length; i++) {
- GLCapabilitiesImmutable caps = available[i];
- if (caps != null && caps.getSampleBuffers()) {
+ for (int i = 0; i < available.size(); i++) {
+ GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
+ if ( caps.getSampleBuffers() ) {
anyHaveSampleBuffers = true;
break;
}
@@ -57,7 +58,8 @@ class MultisampleChooser01 extends DefaultGLCapabilitiesChooser {
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()) {
+ GLCapabilitiesImmutable selected = (GLCapabilitiesImmutable) available.get(selection);
+ if (!selected.getSampleBuffers()) {
System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
}
}