aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2011-03-26 01:01:54 +0100
committerSven Gothel <sgothel@jausoft.com>2011-03-26 01:01:54 +0100
commitcd71c42b6381d48b3e0cf84c3fa215a5166c50c1 (patch)
tree82222419bafe62be77c7deb5ae9dd9ef9cce4fdf /src/test/com
parent14c193e2ec44f6bcff6dfffa85042518e364478c (diff)
Fix Bug460 test
Diffstat (limited to 'src/test/com')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java37
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);
}
}