diff options
Diffstat (limited to 'src/newt')
3 files changed, 61 insertions, 21 deletions
diff --git a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java index 9dace822f..74186f70f 100644 --- a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java +++ b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java @@ -34,6 +34,9 @@ package com.jogamp.newt.impl; +import java.util.ArrayList; +import java.lang.reflect.Method; + import com.jogamp.common.util.ReflectionUtil; import com.jogamp.newt.NewtFactory; import com.jogamp.newt.Display; @@ -52,8 +55,6 @@ import com.jogamp.newt.event.WindowEvent; import com.jogamp.newt.event.WindowListener; import com.jogamp.newt.event.WindowUpdateEvent; -import java.util.ArrayList; -import java.lang.reflect.Method; import javax.media.nativewindow.AbstractGraphicsConfiguration; import javax.media.nativewindow.AbstractGraphicsDevice; import javax.media.nativewindow.CapabilitiesChooser; 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/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i<availCaps.size(); i++) { + s = ((GLCapabilitiesImmutable) availCaps.get(i)).toString(); + System.err.println(s); + tareaCaps.append(s); + tareaCaps.append(Platform.getNewline()); + } - add(tarea, BorderLayout.CENTER); + Container grid = new Container(); + grid.setLayout(new GridLayout(2, 1)); + grid.add(tareaVersion); + grid.add(tareaCaps); + add(grid, BorderLayout.CENTER); - canvas = new GLCanvas(); + canvas = new GLCanvas(glcaps); canvas.addGLEventListener(new GLInfo()); canvas.setSize(10, 10); add(canvas, BorderLayout.SOUTH); @@ -98,8 +126,8 @@ public class VersionApplet extends Applet { remove(canvas); canvas.destroy(); canvas = null; - remove(tarea); - tarea=null; + remove(tareaVersion); + tareaVersion=null; } } @@ -130,7 +158,7 @@ public class VersionApplet extends Applet { GL gl = drawable.getGL(); String s = JoglVersion.getInstance().getGLInfo(gl, null).toString(); System.err.println(s); - tarea.append(s); + tareaVersion.append(s); } public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 4a1855d05..6886fc71b 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -34,18 +34,22 @@ package com.jogamp.newt.opengl; +import java.util.List; + import com.jogamp.common.GlueGenVersion; import com.jogamp.common.util.VersionUtil; import com.jogamp.nativewindow.NativeWindowVersion; import com.jogamp.newt.*; import com.jogamp.newt.event.*; import com.jogamp.newt.impl.WindowImpl; + import javax.media.nativewindow.*; import javax.media.nativewindow.util.Point; +import javax.media.nativewindow.util.Insets; import javax.media.opengl.*; + import com.jogamp.opengl.impl.GLDrawableHelper; import com.jogamp.opengl.JoglVersion; -import javax.media.nativewindow.util.Insets; /** * An implementation of {@link javax.media.opengl.GLAutoDrawable} interface, @@ -895,7 +899,14 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer { System.err.println(NativeWindowVersion.getInstance()); System.err.println(JoglVersion.getInstance()); System.err.println(NewtVersion.getInstance()); - GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault() ); + + GLProfile glp = GLProfile.getDefault(); + GLDrawableFactory factory = GLDrawableFactory.getFactory(glp); + List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i<availCaps.size(); i++) { + System.err.println(availCaps.get(i)); + } + GLCapabilitiesImmutable caps = new GLCapabilities( glp ); GLWindow glWindow = GLWindow.create(caps); glWindow.setSize(128, 128); |