Project

General

Profile

« Previous | Next » 

Revision 6979a0e0

Added by Leszek Koltunski over 3 years ago

Remove all the calls to DistortedLibrary.setMax() (except for app 'Check', which explictly checks this API)

View differences:

src/main/java/org/distorted/examples/listener/ListenerRenderer.java
28 28

  
29 29
import org.distorted.examples.R;
30 30

  
31
import org.distorted.library.effect.EffectType;
32 31
import org.distorted.library.effect.MatrixEffectScale;
33 32
import org.distorted.library.effect.VertexEffectDistort;
34 33
import org.distorted.library.main.DistortedLibrary;
......
46 45
import android.opengl.GLSurfaceView;
47 46

  
48 47
///////////////////////////////////////////////////////////////////////////////////////////////////
49
// Show how to use the setMax, notifyWhenFinished / effectFinished APIs
48
// Show how to use the notifyWhenFinished / effectFinished APIs
50 49

  
51 50
class ListenerRenderer implements GLSurfaceView.Renderer, EffectListener, DistortedLibrary.ExceptionListener
52 51
{
......
162 161
         {
163 162
         is.close();
164 163
         }
165
       catch(IOException e) { }
164
       catch(IOException ignored) { }
166 165
       }
167 166

  
168 167
     mBmpRatio = (float)bitmap.getHeight()/bitmap.getWidth();
......
173 172
     mScreen.detachAll();
174 173
     mScreen.attach(mTexture,mEffects,mMesh);
175 174

  
176
     // Normally we can only hold no more than 5 (see EffectType.reset()) Vertex
177
     // effects at any given time. Here we want 12, so we need to increase the default.
178
     // We need to call this before we call onCreate; best done here.
179
     // After onCreate we can also call this but only to decrease this value!
180
     //
181
     // One more than we have bubbles at any given time because it can sometimes
182
     // happen that the old bubble is not yet removed when we add a new one.
183
     DistortedLibrary.setMax(EffectType.VERTEX,NUM_CONCURRENT_BUBBLES+1);
184 175
     VertexEffectDistort.enable();
185 176

  
186 177
     DistortedLibrary.onSurfaceCreated(mView.getContext(), this);

Also available in: Unified diff