TestRenderToMemory to use the same read-back method as AwtPanels

experimental
shadowislord 10 years ago
parent f638afbeb7
commit 7bd07d144e
  1. 6
      jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java

@ -86,7 +86,7 @@ public class TestRenderToMemory extends SimpleApplication implements SceneProces
private final ByteBuffer cpuBuf = BufferUtils.createByteBuffer(width * height * 4);
private final byte[] cpuArray = new byte[width * height * 4];
private final BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_4BYTE_ABGR);
BufferedImage.TYPE_INT_BGR);
private class ImageDisplay extends JPanel {
@ -159,10 +159,10 @@ public class TestRenderToMemory extends SimpleApplication implements SceneProces
public void updateImageContents(){
cpuBuf.clear();
renderer.readFrameBufferWithFormat(offBuffer, cpuBuf, Image.Format.BGRA8);
renderer.readFrameBuffer(offBuffer, cpuBuf);
synchronized (image) {
Screenshots.convertScreenShot(cpuBuf, image);
Screenshots.convertScreenShot2(cpuBuf.asIntBuffer(), image);
}
if (display != null)

Loading…
Cancel
Save