Used the dipose method of native object to delete framebuffers and textures when the Fpp is cleaned up

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10981 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
rem..om 11 years ago
parent 4c6371e63d
commit ce6d0d0065
  1. 6
      engine/src/core/com/jme3/post/Filter.java
  2. 9
      engine/src/core/com/jme3/post/FilterPostProcessor.java

@ -192,10 +192,10 @@ public abstract class Filter implements Savable {
}
public void cleanup(Renderer r) {
r.deleteFrameBuffer(renderFrameBuffer);
r.deleteImage(renderedTexture.getImage());
renderFrameBuffer.dispose();
renderedTexture.getImage().dispose();
if(depthTexture!=null){
r.deleteImage(depthTexture.getImage());
depthTexture.getImage().dispose();
}
}
}

@ -378,13 +378,14 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
viewPort.getCamera().setViewPort(left, right, bottom, top);
viewPort.setOutputFrameBuffer(outputBuffer);
viewPort = null;
renderManager.getRenderer().deleteFrameBuffer(renderFrameBuffer);
renderFrameBuffer.dispose();
if(depthTexture!=null){
renderManager.getRenderer().deleteImage(depthTexture.getImage());
depthTexture.getImage().dispose();
}
renderManager.getRenderer().deleteImage(filterTexture.getImage());
filterTexture.getImage().dispose();
if(renderFrameBufferMS != null){
renderManager.getRenderer().deleteFrameBuffer(renderFrameBufferMS);
renderFrameBufferMS.dispose();
}
for (Filter filter : filters) {
filter.cleanup(renderer);

Loading…
Cancel
Save