diff options
Diffstat (limited to 'src/test/com')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java index fea835377..6de9e9788 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java @@ -28,20 +28,8 @@ package com.jogamp.opengl.test.junit.jogl.awt; -import java.util.Collections; -import java.util.SortedSet; -import java.util.TreeSet; - -import javax.media.nativewindow.AbstractGraphicsDevice; -import javax.media.opengl.DefaultGLCapabilitiesChooser; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesChooser; import javax.media.opengl.GLCapabilitiesImmutable; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLPbuffer; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; @@ -51,30 +39,19 @@ public class TestBug460GLCanvasNPEAWT { public static void main(String[] args) { TestBug460GLCanvasNPEAWT instance = new TestBug460GLCanvasNPEAWT(); - instance.testJogl2ExtensionCheck(); + instance.testIncompleteGLCanvasNPE(); } @Test - public void testJogl2ExtensionCheck() { + public void testIncompleteGLCanvasNPE() { GLProfile.initSingleton(false); -// GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2)); GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); GLCanvas glc = new GLCanvas(caps); - GLDrawableFactory usine = glc.getFactory(); - GLCapabilitiesImmutable glci = glc.getChosenGLCapabilities(); - GLCapabilitiesChooser glcc = new DefaultGLCapabilitiesChooser(); - AbstractGraphicsDevice agd = usine.getDefaultDevice(); - - GLPbuffer pbuffer = usine.createGLPbuffer(agd, glci, glcc, 256, 256, null); - GLContext context = pbuffer.getContext(); - context.makeCurrent(); - GL2 gl = pbuffer.getContext().getGL().getGL2(); - - String extensions = gl.glGetString(GL.GL_EXTENSIONS); - String[] tabExtensions = extensions.split(" "); - SortedSet<String> setExtensions = new TreeSet<String>(); - Collections.addAll(setExtensions, tabExtensions); - System.out.println(setExtensions); + // GLDrawableFactory factory = glc.getFactory(); // null ok: not realized + // GLCapabilitiesImmutable glci = glc.getChosenGLCapabilities(); -> NPE ok: .. not realized + GLCapabilitiesImmutable glCapsRequested = glc.getRequestedGLCapabilities(); + System.out.println("ReqCaps: "+glCapsRequested); + System.out.println("GLCanvas: "+glc); } } |