summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java19
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java51
2 files changed, 70 insertions, 0 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
index dd16b88cc..9841bb35e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
@@ -213,6 +213,25 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
setTitle(frame, glJPanel, caps);
Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
+ } else if(e.getKeyChar()=='m') {
+ final GLCapabilitiesImmutable capsPre = glJPanel.getChosenGLCapabilities();
+ final GLCapabilities capsNew = new GLCapabilities(capsPre.getGLProfile());
+ capsNew.copyFrom(capsPre);
+ final boolean msaa;
+ if( capsPre.getSampleBuffers() ) {
+ capsNew.setSampleBuffers(false);
+ msaa = false;
+ } else {
+ capsNew.setSampleBuffers(true);
+ capsNew.setNumSamples(4);
+ msaa = true;
+ }
+ System.err.println("[set MSAA "+msaa+" Caps had]: "+capsPre);
+ System.err.println("[set MSAA "+msaa+" Caps new]: "+capsNew);
+ System.err.println("XXX-A1: "+animator.toString());
+ glJPanel.setRequestedGLCapabilities(capsNew);
+ System.err.println("XXX-A2: "+animator.toString());
+ System.err.println("XXX: "+glJPanel.toString());
}
} };
new AWTKeyAdapter(kl, glJPanel).addTo(glJPanel);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
index 3650e4955..f47a9b794 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
@@ -30,6 +30,7 @@ package com.jogamp.opengl.test.junit.jogl.demos.gl2.awt;
import javax.media.opengl.*;
+import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.event.TraceKeyAdapter;
import com.jogamp.newt.event.TraceWindowAdapter;
import com.jogamp.newt.event.awt.AWTKeyAdapter;
@@ -121,6 +122,56 @@ public class TestGearsGLJPanelAWT extends UITestCase {
new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glJPanel).addTo(glJPanel);
new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glJPanel).addTo(frame);
+ final com.jogamp.newt.event.KeyListener kl = new com.jogamp.newt.event.KeyAdapter() {
+ @Override
+ public void keyPressed(final KeyEvent e) {
+ if( e.isAutoRepeat() ) {
+ return;
+ }
+ if(e.getKeyChar()=='m') {
+ final GLCapabilitiesImmutable capsPre = glJPanel.getChosenGLCapabilities();
+ final GLCapabilities capsNew = new GLCapabilities(capsPre.getGLProfile());
+ capsNew.copyFrom(capsPre);
+ final boolean msaa;
+ if( capsPre.getSampleBuffers() ) {
+ capsNew.setSampleBuffers(false);
+ capsNew.setDoubleBuffered(false);
+ msaa = false;
+ } else {
+ capsNew.setSampleBuffers(true);
+ capsNew.setNumSamples(4);
+ msaa = true;
+ }
+ System.err.println("[set MSAA "+msaa+" Caps had]: "+capsPre);
+ System.err.println("[set MSAA "+msaa+" Caps new]: "+capsNew);
+ System.err.println("XXX-A1: "+animator.toString());
+ glJPanel.setRequestedGLCapabilities(capsNew);
+ System.err.println("XXX-A2: "+animator.toString());
+ System.err.println("XXX: "+glJPanel.toString());
+ } else if(e.getKeyChar()=='b') {
+ final GLCapabilitiesImmutable capsPre = glJPanel.getChosenGLCapabilities();
+ final GLCapabilities capsNew = new GLCapabilities(capsPre.getGLProfile());
+ capsNew.copyFrom(capsPre);
+ final boolean bmp;
+ if( capsPre.isBitmap() ) {
+ capsNew.setBitmap(false); // auto-choose
+ bmp = false;
+ } else {
+ capsNew.setBitmap(true);
+ capsNew.setFBO(false);
+ capsNew.setPBuffer(false);
+ bmp = true;
+ }
+ System.err.println("[set Bitmap "+bmp+" Caps had]: "+capsPre);
+ System.err.println("[set Bitmap "+bmp+" Caps new]: "+capsNew);
+ System.err.println("XXX-A1: "+animator.toString());
+ glJPanel.setRequestedGLCapabilities(capsNew);
+ System.err.println("XXX-A2: "+animator.toString());
+ System.err.println("XXX: "+glJPanel.toString());
+ }
+ } };
+ new AWTKeyAdapter(kl, glJPanel).addTo(glJPanel);
+
final long t0 = System.currentTimeMillis();
long t1 = t0;
boolean triggerSnap = false;