diff options
author | Rami Santina <[email protected]> | 2011-03-28 11:49:57 +0300 |
---|---|---|
committer | Rami Santina <[email protected]> | 2011-03-28 11:49:57 +0300 |
commit | 3bf42d92a3baf5e506f553fc20c71c082c39790e (patch) | |
tree | 6bc1f76b2fd1461a29530c090e498fac25c85f20 /src/demo/GPUTextNewtDemo01.java | |
parent | 23646bedac2fe9ff27e35ac167e6872afb84fc50 (diff) |
Added print screen to TGA file to be used in junit
Diffstat (limited to 'src/demo/GPUTextNewtDemo01.java')
-rw-r--r-- | src/demo/GPUTextNewtDemo01.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/demo/GPUTextNewtDemo01.java b/src/demo/GPUTextNewtDemo01.java index ad1020122..76593278f 100644 --- a/src/demo/GPUTextNewtDemo01.java +++ b/src/demo/GPUTextNewtDemo01.java @@ -27,9 +27,12 @@ */ package demo; +import java.io.IOException; + import javax.media.opengl.GL2ES2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; import com.jogamp.graph.curve.Region; @@ -47,7 +50,7 @@ public class GPUTextNewtDemo01 { } TextGLListener textGLListener = null; - + GLWindow window; public void testMe() { GLProfile.initSingleton(true); GLProfile glp = GLProfile.getGL2ES2(); @@ -57,7 +60,7 @@ public class GPUTextNewtDemo01 { caps.setNumSamples(4); // 2 samples is not enough .. System.out.println("Requested: "+caps); - final GLWindow window = GLWindow.create(caps); + window = GLWindow.create(caps); window.setPosition(10, 10); window.setSize(500, 500); @@ -95,5 +98,20 @@ public class GPUTextNewtDemo01 { //gl.glEnable(GL2GL3.GL_SAMPLE_ALPHA_TO_ONE); MSAATool.dump(drawable); } + + public void display(GLAutoDrawable drawable) { + super.display(drawable); + + if(printScreen){ + try { + super.printScreen(window, "./","r2t0-msaa1", false); + printScreen=false; + } catch (GLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } } } |