summaryrefslogtreecommitdiffstats
path: root/src/demo/Screenshot.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demo/Screenshot.java')
-rw-r--r--src/demo/Screenshot.java39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/demo/Screenshot.java b/src/demo/Screenshot.java
deleted file mode 100644
index 8e05b17ea..000000000
--- a/src/demo/Screenshot.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package demo;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GLAutoDrawable;
-
-import com.jogamp.opengl.util.texture.TextureIO;
-
-public class Screenshot {
-
- ReadBufferUtil readBufferUtil = new ReadBufferUtil();
-
- public void dispose() {
- readBufferUtil.dispose();
- }
-
- public void surface2File(GLAutoDrawable drawable, String filename) {
- GL gl = drawable.getGL();
- // FIXME glFinish() is an expensive paranoia sync, should not be necessary due to spec
- gl.glFinish();
- readBufferUtil.fetchOffscreenTexture(drawable, gl);
- gl.glFinish();
- try {
- surface2File(filename);
- } catch (IOException ex) {
- throw new RuntimeException("can not write survace to file", ex);
- }
- }
-
- void surface2File(String filename) throws IOException {
- File file = new File(filename);
- TextureIO.write(readBufferUtil.getTextureData(), file);
- System.err.println("Wrote: " + file.getAbsolutePath() + ", ...");
- readBufferUtil.rewindPixelBuffer();
- }
-
-}