From 8adc04788a6d9dd44de5a4636b46d14dbb70b799 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 31 Jan 2011 07:42:43 +0100 Subject: 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 /**/ 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 --- .../test/junit/jogl/acore/TestGLProfile01NEWT.java | 23 ++++++++++++++-------- .../test/junit/jogl/caps/MultisampleChooser01.java | 12 ++++++----- 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'src/test/com') 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/**/ availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i*/ 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"); } } -- cgit v1.2.3