Project

General

Profile

« Previous | Next » 

Revision 59540ba2

Added by Leszek Koltunski about 7 years ago

Convert (almost) all remaining Apps to the new API which avoids memory leaks with Surfaces.

Remaining problematic Apps: 15. FBO 16. Star Wars (both leak Tree FBOs) 22. SurfaceView (does not work at all after going to background)

View differences:

src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java
46 46
{
47 47
   private GLSurfaceView mView;
48 48
   private DistortedEffects mEffects;
49
   private DistortedTexture mTexture;
49 50
   private DistortedScreen mScreen;
50 51
   private AroundTheWorldEffectsManager mManager;
51 52
   private int mObjWidth, mObjHeight;
......
126 127
      mObjWidth = bitmap.getWidth();
127 128
      mObjHeight= bitmap.getHeight();
128 129

  
129
      DistortedTexture texture = new DistortedTexture(mObjWidth,mObjHeight);
130
      texture.setTexture(bitmap);
131

  
132
      MeshFlat mesh = new MeshFlat(30,30*mObjHeight/mObjWidth);
130
      if( mTexture==null ) mTexture = new DistortedTexture(mObjWidth,mObjHeight);
131
      mTexture.setTexture(bitmap);
133 132

  
134 133
      mScreen.detachAll();
135
      mScreen.attach(texture, mEffects, mesh );
134
      mScreen.attach(mTexture, mEffects, new MeshFlat(30,30*mObjHeight/mObjWidth));
136 135

  
137 136
      DistortedEffects.enableEffect(EffectNames.DISTORT);
138 137
      DistortedEffects.enableEffect(EffectNames.SINK);

Also available in: Unified diff