aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-08 15:13:00 +0200
committerSven Gothel <[email protected]>2013-09-08 15:13:00 +0200
commit8313200af6da93f83bc70a645e79bfdeb22f05d4 (patch)
tree7d5618c9d3face58de56a8a08fdbfa660e845a8b /src/test/com/jogamp
parent78b65d52385f4a15e4357d0444ea9daec54fb173 (diff)
TileRenderer*: Fix pre-swap and post-swap in regards to endTile(..), i.e. pre-swap only for FBO && MSAA. See TileRendererBase.reqPreSwapBuffers(..) API doc.
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java72
1 files changed, 56 insertions, 16 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
index be209412e..26ac34d5a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
@@ -27,6 +27,7 @@
*/
package com.jogamp.opengl.test.junit.jogl.tile;
+import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -44,7 +45,6 @@ import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLEventListener;
-import javax.media.opengl.GLOffscreenAutoDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLRunnable;
@@ -91,49 +91,89 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
- public void test01_gl2___aa0() throws IOException {
+ public void test001_off_gl2___aa0() throws IOException {
GLProfile glp = getGLProfile(GLProfile.GL2);
if( null == glp ) {
return;
}
- doTest(new Gears(), glp, 0);
+ doTest(false, new Gears(), glp, 0);
}
@Test
- public void test02_gl2___aa8() throws IOException {
+ public void test002_off_gl2___aa8() throws IOException {
GLProfile glp = getGLProfile(GLProfile.GL2);
if( null == glp ) {
return;
}
- doTest(new Gears(), glp, 8);
+ doTest(false, new Gears(), glp, 8);
}
@Test
- public void test11_gl2es3_aa0() throws IOException {
+ public void test011_off_gl2es3_aa0() throws IOException {
GLProfile glp = getGL2ES3();
if( null == glp ) {
return;
}
- doTest(new GearsES2(), glp, 0);
+ doTest(false, new GearsES2(), glp, 0);
}
@Test
- public void test12_gl2es3_aa8() throws IOException {
+ public void test012_off_gl2es3_aa8() throws IOException {
GLProfile glp = getGL2ES3();
if( null == glp ) {
return;
}
- doTest(new GearsES2(), glp, 8);
+ doTest(false, new GearsES2(), glp, 8);
+ }
+ @Test
+ public void test101_on__gl2___aa0() throws IOException {
+ GLProfile glp = getGLProfile(GLProfile.GL2);
+ if( null == glp ) {
+ return;
+ }
+ doTest(true, new Gears(), glp, 0);
+ }
+ @Test
+ public void test102_on__gl2___aa8() throws IOException {
+ GLProfile glp = getGLProfile(GLProfile.GL2);
+ if( null == glp ) {
+ return;
+ }
+ doTest(true, new Gears(), glp, 8);
+ }
+ @Test
+ public void test111_on__gl2es3_aa0() throws IOException {
+ GLProfile glp = getGL2ES3();
+ if( null == glp ) {
+ return;
+ }
+ doTest(true, new GearsES2(), glp, 0);
+ }
+ @Test
+ public void test112_on__gl2es3_aa8() throws IOException {
+ GLProfile glp = getGL2ES3();
+ if( null == glp ) {
+ return;
+ }
+ doTest(true, new GearsES2(), glp, 8);
}
- void doTest(final GLEventListener demo, GLProfile glp, final int msaaCount) throws IOException {
- GLCapabilities caps = new GLCapabilities(glp);
- caps.setDoubleBuffered(false);
+ void doTest(boolean onscreen, final GLEventListener demo, GLProfile glp, final int msaaCount) throws IOException {
+ GLCapabilities caps = new GLCapabilities(glp);
+ caps.setDoubleBuffered(onscreen);
if( msaaCount > 0 ) {
caps.setSampleBuffers(true);
caps.setNumSamples(msaaCount);
}
final int maxTileSize = 256;
- final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
- final GLOffscreenAutoDrawable glad = factory.createOffscreenAutoDrawable(null, caps, null, maxTileSize, maxTileSize, null);
+ final GLAutoDrawable glad;
+ if( onscreen ) {
+ final GLWindow glWin = GLWindow.create(caps);
+ glWin.setSize(maxTileSize, maxTileSize);
+ glWin.setVisible(true);
+ glad = glWin;
+ } else {
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+ glad = factory.createOffscreenAutoDrawable(null, caps, null, maxTileSize, maxTileSize, null);
+ }
glad.addGLEventListener( demo );
@@ -192,8 +232,6 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
});
- glad.destroy();
-
final GLPixelBuffer imageBuffer = renderer.getImageBuffer();
final TextureData textureData = new TextureData(
caps.getGLProfile(),
@@ -207,6 +245,8 @@ public class TestTiledRendering2NEWT extends UITestCase {
null /* Flusher */);
TextureIO.write(textureData, file);
+
+ glad.destroy();
}
public static void main(String args[]) {