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 --- .../jogamp/newt/impl/awt/opengl/VersionApplet.java | 62 ++++++++++++++++------ .../classes/com/jogamp/newt/opengl/GLWindow.java | 15 +++++- 2 files changed, 58 insertions(+), 19 deletions(-) (limited to 'src/newt/classes') diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java b/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java index 7fb3268f9..f31d1bc0f 100644 --- a/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java +++ b/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java @@ -1,27 +1,38 @@ package com.jogamp.newt.impl.awt.opengl; -import com.jogamp.common.GlueGenVersion; -import com.jogamp.common.util.VersionUtil; -import com.jogamp.nativewindow.NativeWindowVersion; -import com.jogamp.newt.NewtVersion; -import com.jogamp.opengl.JoglVersion; import java.applet.Applet; import java.awt.BorderLayout; +import java.awt.Container; import java.awt.Frame; +import java.awt.GridLayout; import java.awt.TextArea; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; + +import java.util.List; + import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLCapabilitiesImmutable; +import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLEventListener; +import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.os.Platform; +import com.jogamp.common.util.VersionUtil; +import com.jogamp.nativewindow.NativeWindowVersion; +import com.jogamp.newt.NewtVersion; +import com.jogamp.opengl.JoglVersion; + public class VersionApplet extends Applet { static { GLProfile.initSingleton(false); } - TextArea tarea; + TextArea tareaVersion; + TextArea tareaCaps; GLCanvas canvas; public static void main(String[] args) { @@ -60,33 +71,50 @@ public class VersionApplet extends Applet { private synchronized void my_init() { if(null != canvas) { return; } + GLProfile glp = GLProfile.getDefault(); + GLCapabilities glcaps = new GLCapabilities(glp); + setLayout(new BorderLayout()); String s; - tarea = new TextArea(120, 80); + tareaVersion = new TextArea(120, 60); s = VersionUtil.getPlatformInfo().toString(); System.err.println(s); - tarea.append(s); + tareaVersion.append(s); s = GlueGenVersion.getInstance().toString(); System.err.println(s); - tarea.append(s); + tareaVersion.append(s); s = NativeWindowVersion.getInstance().toString(); System.err.println(s); - tarea.append(NativeWindowVersion.getInstance().toString()); + tareaVersion.append(NativeWindowVersion.getInstance().toString()); s = JoglVersion.getInstance().toString(); System.err.println(s); - tarea.append(s); + tareaVersion.append(s); s = NewtVersion.getInstance().toString(); System.err.println(s); - tarea.append(s); + tareaVersion.append(s); + + tareaCaps = new TextArea(120, 20); + GLDrawableFactory factory = GLDrawableFactory.getFactory(glp); + List/**/ availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i*/ availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i